@motion.page/sdk 1.0.5 → 1.0.7
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.
- package/dist/index.cjs +16 -14
- package/dist/index.cjs.map +9 -9
- package/dist/index.js +16 -14
- package/dist/index.js.map +9 -9
- package/dist/registries/SDKRegistry.d.ts +2 -1
- package/dist/triggers/PinManager.d.ts +5 -2
- package/dist/utils/TextSplitter.d.ts +56 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,32 +1,34 @@
|
|
|
1
|
-
function w(J,$){switch(J){case"play":case"resume":$.play();break;case"pause":$.pause();break;case"reverse":$.reverse();break;case"restart":$.restart();break;case"reset":$.pause(),$.progress(0);break;case"complete":$.progress(1),$.pause();break;case"none":break;default:console.warn(`[Motion] Unknown timeline action: "${J}". Valid actions: play, pause, resume, reverse, restart, reset, complete, none`)}}var U={color:null,filter:null,drawSVG:null,stagger:null,textSplitter:null,triggerManager:null,styleReset:null,fit:null};class I{static _instance;static _triggerRegistry=new Map;static _pageLoadTriggerFactory=null;static _RESIZE_DEBOUNCE_MS=200;_pageLoadTrigger=null;_scrollTriggers=new Map;_eventTriggers=new Map;_mouseMoveTriggers=new Map;_gestureTriggers=new Map;_cursorTriggers=new Map;_pageExitTriggers=new Map;_resizeHandler=null;_resizeTimer=null;get _allTriggerMaps(){return[this._scrollTriggers,this._eventTriggers,this._mouseMoveTriggers,this._gestureTriggers,this._cursorTriggers,this._pageExitTriggers]}constructor(){}static getInstance(){if(!I._instance)I._instance=new I;return I._instance}static registerTrigger(J,$){I._triggerRegistry.set(J,$)}static registerPageLoadTrigger(J){I._pageLoadTriggerFactory=J}_getPageLoadTrigger(){if(!this._pageLoadTrigger&&I._pageLoadTriggerFactory)this._pageLoadTrigger=new I._pageLoadTriggerFactory;return this._pageLoadTrigger}_createTrigger(J,...$){let Q=I._triggerRegistry.get(J);if(!Q){let q=Array.from(I._triggerRegistry.keys());return console.warn(`[Motion SDK] Trigger type '${J}' is not available in this bundle. Available triggers: ${q.join(", ")||"none"}. Animations using .on${J.charAt(0).toUpperCase()+J.slice(1)}() will be skipped.`),null}return new Q(...$)}registerPageLoad(J,$){this.unregister(J);let Q=this._getPageLoadTrigger();if(Q)Q.register(J,$)}_attachResizeListener(){if(this._resizeHandler||typeof window>"u")return;this._resizeHandler=()=>{if(this._resizeTimer!==null)clearTimeout(this._resizeTimer);this._resizeTimer=setTimeout(()=>{this._resizeTimer=null,this.refreshScrollTriggers()},I._RESIZE_DEBOUNCE_MS)},window.addEventListener("resize",this._resizeHandler,{passive:!0})}_detachResizeListener(){if(!this._resizeHandler||typeof window>"u")return;if(window.removeEventListener("resize",this._resizeHandler),this._resizeTimer!==null)clearTimeout(this._resizeTimer),this._resizeTimer=null;this._resizeHandler=null}registerScroll(J,$){this.unregister(J);let Q=this._createTrigger("scroll",J,$);if(!Q)return;this._scrollTriggers.set(J,Q),J._trigger=Q,Q.enable(),this._attachResizeListener()}registerHover(J,$){this.unregister(J);let Q=this._createTrigger("event",J,{type:"hover",target:$.target,onLeave:$.onLeave,leaveDelay:$.leaveDelay});if(!Q)return;this._eventTriggers.set(J,Q),J._trigger=Q,Q.enable()}registerClick(J,$){this.unregister(J);let Q=this._createTrigger("event",J,{type:"click",target:$.target,secondTarget:$.secondTarget,toggle:$.toggle,preventDefault:$.preventDefault});if(!Q)return;this._eventTriggers.set(J,Q),J._trigger=Q,Q.enable()}registerMouseMove(J,$){this.unregister(J);let Q=this._createTrigger("mouseMove",J,$);if(!Q)return;this._mouseMoveTriggers.set(J,Q),J._trigger=Q,Q.enable()}registerGesture(J,$){this.unregister(J);let Q=this._createTrigger("gesture",J,$);if(!Q)return;this._gestureTriggers.set(J,Q),J._trigger=Q,Q.enable()}registerCursor(J,$){this.unregister(J);let Q=this._createTrigger("cursor",J,$);if(!Q)return;this._cursorTriggers.set(J,Q),J._trigger=Q,Q.enable()}registerPageExit(J,$){this.unregister(J);let Q=this._createTrigger("pageExit",J,$);if(!Q)return;this._pageExitTriggers.set(J,Q),J._trigger=Q,Q.enable()}unregister(J){let $=this._getPageLoadTrigger();if($)$.unregister(J);for(let Q of this._allTriggerMaps){let q=Q.get(J);if(q)q.disable(),Q.delete(J)}if(J._trigger=void 0,this._scrollTriggers.size===0)this._detachResizeListener()}refreshScrollTriggers(){let J=Array.from(this._scrollTriggers.values()),$=typeof window<"u"?window.scrollY:0;J.sort((Q,q)=>{let Z=Q._pinManager?.getLayoutRect?.(),j=q._pinManager?.getLayoutRect?.();if(!Z&&!j)return 0;if(!Z)return 1;if(!j)return-1;return Z.top+$-(j.top+$)}),J.forEach((Q)=>Q.refresh?.()),this._eventTriggers.forEach((Q)=>Q.refresh?.()),this._gestureTriggers.forEach((Q)=>Q.refresh?.()),this._mouseMoveTriggers.forEach((Q)=>Q.refresh?.())}killAll(){let J=this._getPageLoadTrigger();if(J)J.clear();for(let $ of this._allTriggerMaps)$.forEach((Q)=>Q.disable()),$.clear();this._detachResizeListener()}static _reset(){if(I._instance){if(I._instance._pageLoadTrigger)I._instance._pageLoadTrigger._reset();I._instance.killAll(),I._instance=void 0}}}U.triggerManager={getInstance:I.getInstance};function LJ(J){if(typeof document>"u"){J();return}if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",J,{once:!0});else J()}function OJ(J){if(J===null||typeof J!=="object")return!1;if(J instanceof Element)return!1;if("nodeType"in J)return!1;if("style"in J)return!1;let $=J;if("x"in $&&typeof $.x==="number")return!0;if("length"in J)return!1;return!0}function K0(J){return J instanceof Element||typeof J==="object"&&J!==null&&(("nodeType"in J)||("style"in J))}function k0(J){if(OJ(J))return[J];if(typeof J==="string"){if(typeof document<"u")try{return Array.from(document.querySelectorAll(J))}catch($){return console.warn(`[Motion] Invalid selector "${J}":`,$),[]}return[]}if(J instanceof Element)return[J];if(J&&typeof J==="object"&&"style"in J&&!Array.isArray(J))return[J];if(J instanceof NodeList)return Array.from(J);if(Array.isArray(J)){if(J.length===0)return[];if(typeof J[0]==="string"){if(typeof document>"u")return[];let $=[];for(let Q of J)try{$.push(...Array.from(document.querySelectorAll(Q)))}catch(q){console.warn(`[Motion] Invalid selector "${Q}":`,q)}return $}if(OJ(J[0]))return J;return J}if(J&&typeof J==="object"&&"length"in J)return Array.from(J);return[]}class f{_timeline;_config;_enabled=!1;constructor(J,$){this._timeline=J,this._config=$}enable(){if(this._enabled)return;this._enabled=!0,LJ(()=>{if(!this._enabled)return;this._onEnable()})}disable(){if(!this._enabled)return;this._enabled=!1,this._onDisable()}_resolveElement(J,$){if(J===void 0||J===null)return $??null;if(typeof J!=="string")return J;if(typeof document<"u")try{let Q=document.querySelector(J);if(Q!==null)return Q}catch(Q){console.warn(`[Motion] Invalid selector "${J}":`,Q)}return $??null}_resolveElements(J){if(J===void 0||J===null)return[];if(typeof J!=="string")return[J];if(typeof document<"u")try{let $=document.querySelectorAll(J);return Array.from($)}catch($){return console.warn(`[Motion] Invalid selector "${J}":`,$),[]}return[]}_cleanupListenerMap(J){J.forEach(($,Q)=>{$.forEach((q,Z)=>{Q.removeEventListener(Z,q)})}),J.clear()}}function u(J){let $=J,Q=$.style.transform,q=$.style.transition;$.style.transition="none",$.style.transform="none";let Z=!1,j=$.style.position,G=$.style.top,z=$.style.left,W=$.style.width;if(j==="fixed")Z=!0;else if(j===""||j===void 0){if(typeof window<"u"&&typeof window.getComputedStyle==="function"&&window.getComputedStyle($).position==="fixed")Z=!0}if(Z)$.style.position="",$.style.top="",$.style.left="",$.style.width="";let B=$.getBoundingClientRect();if($.style.transform=Q,$.style.transition=q,Z)$.style.position=j,$.style.top=G,$.style.left=z,$.style.width=W;return B}class MJ extends f{_targets=[];_secondTargets=[];_listeners=new Map;_isForward=!0;_frozenRects=new Map;_snapshotScrollX=0;_snapshotScrollY=0;_wasHovering=!1;_hoverLeaveTimeout=null;_boundMouseMoveHandler=null;constructor(J,$){super(J,$)}_onEnable(){if(this._resolveTargets(),this._config.type==="hover")this._addHoverListeners();else if(this._config.type==="click")this._addClickListeners()}_onDisable(){if(this._boundMouseMoveHandler)window.removeEventListener("mousemove",this._boundMouseMoveHandler),this._boundMouseMoveHandler=null;if(this._hoverLeaveTimeout!==null)clearTimeout(this._hoverLeaveTimeout),this._hoverLeaveTimeout=null;this._frozenRects.clear(),this._wasHovering=!1,this._cleanupListenerMap(this._listeners)}refresh(){if(this._config.type!=="hover")return;this._snapshotRects()}_snapshotRects(){this._snapshotScrollX=window.scrollX||0,this._snapshotScrollY=window.scrollY||0;for(let J of this._targets)this._frozenRects.set(J,u(J))}_resolveTargets(){if(this._targets=this._resolveElements(this._config.target),this._config.secondTarget)this._secondTargets=this._resolveElements(this._config.secondTarget);else this._secondTargets=this._targets}_addHoverListeners(){let J=this._config.onLeave||"reverse",$=this._config.leaveDelay||0;this._snapshotRects(),this._boundMouseMoveHandler=(Q)=>{let q=(window.scrollX||0)-this._snapshotScrollX,Z=(window.scrollY||0)-this._snapshotScrollY,j=Q.clientX+q,G=Q.clientY+Z,z=!1;for(let W of this._frozenRects.values())if(j>=W.left&&j<=W.right&&G>=W.top&&G<=W.bottom){z=!0;break}if(z&&!this._wasHovering){if(this._wasHovering=!0,this._hoverLeaveTimeout!==null)clearTimeout(this._hoverLeaveTimeout),this._hoverLeaveTimeout=null;this._timeline.play()}else if(!z&&this._wasHovering){if(this._wasHovering=!1,J==="none")return;let W=()=>{this._handleLeaveAction(J),this._hoverLeaveTimeout=null};if($>0)this._hoverLeaveTimeout=window.setTimeout(W,$*1000);else W()}},window.addEventListener("mousemove",this._boundMouseMoveHandler)}_handleLeaveAction(J){w(J==="stop"?"reset":J,this._timeline)}_addClickListeners(){let J=this._config.toggle||"play",$=this._config.preventDefault||!1,Q=this._config.secondTarget&&this._config.secondTarget!==this._config.target;if(this._targets.forEach((q)=>{let Z=this._listeners.get(q)||new Map,j=(G)=>{if($)G.preventDefault();if(!Q)if(this._isForward){if(this._timeline.restart(),J!=="play")this._isForward=!1}else this._handleSecondClick(J),this._isForward=!0;else this._timeline.restart()};q.addEventListener("click",j),Z.set("click",j),this._listeners.set(q,Z)}),Q)this._secondTargets.forEach((q)=>{if(this._listeners.has(q))return;let Z=new Map,j=(G)=>{if($)G.preventDefault();this._handleSecondClick(J)};q.addEventListener("click",j),Z.set("click",j),this._listeners.set(q,Z)})}_handleSecondClick(J){w(J,this._timeline)}}I.registerTrigger("event",MJ);var e0={perspective:0,x:1,y:2,z:3,rotate:4,rotateX:5,rotateY:6,rotateZ:7,scale:8,scaleX:9,scaleY:10,scaleZ:11,skewX:12,skewY:13},DJ=["px","px","px","px","deg","deg","deg","deg","","","","","deg","deg"],z0=new WeakMap,D0=new WeakMap,D=[];function g(J){let $=J.trim().match(/([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z%]*)/i);if(!$)return{value:0,unit:""};return{value:parseFloat($[1]),unit:$[2]||""}}function G0(J,$){switch($){case"rad":return J*180/Math.PI;case"turn":return J*360;case"grad":return J*0.9;default:return J}}function r(J){let $=g(J);return G0($.value,$.unit||"deg")}function A(J,$,Q,q){let Z=e0[$];if(Z===void 0)return;J.values[Z]=Q;let j=q&&q.length>0?q:DJ[Z]||"";J.units[Z]=j,J.used|=1<<Z}function H6(J,$){let Q=/([a-zA-Z0-9]+)\(([^)]+)\)/g,q;while((q=Q.exec(J))!==null){let Z=q[1],j=q[2].match(/[-+]?\d*\.?\d+(?:e[-+]?\d+)?[a-z%]*/gi)||[];switch(Z){case"translate":{let G=j[0]?g(j[0]):{value:0,unit:""},z=j[1]?g(j[1]):{value:0,unit:""};A($,"x",G.value,G.unit),A($,"y",z.value,z.unit);break}case"translate3d":{let G=j[0]?g(j[0]):{value:0,unit:""},z=j[1]?g(j[1]):{value:0,unit:""},W=j[2]?g(j[2]):{value:0,unit:""};A($,"x",G.value,G.unit),A($,"y",z.value,z.unit),A($,"z",W.value,W.unit);break}case"translateX":{let G=j[0]?g(j[0]):{value:0,unit:""};A($,"x",G.value,G.unit);break}case"translateY":{let G=j[0]?g(j[0]):{value:0,unit:""};A($,"y",G.value,G.unit);break}case"translateZ":{let G=j[0]?g(j[0]):{value:0,unit:""};A($,"z",G.value,G.unit);break}case"scale":{let G=j[0]?parseFloat(j[0]):1,z=j[1]?parseFloat(j[1]):G;A($,"scaleX",G),A($,"scaleY",z);break}case"scale3d":{let G=j[0]?parseFloat(j[0]):1,z=j[1]?parseFloat(j[1]):1,W=j[2]?parseFloat(j[2]):1;A($,"scaleX",G),A($,"scaleY",z),A($,"scaleZ",W);break}case"scaleX":{let G=j[0]?parseFloat(j[0]):1;A($,"scaleX",G);break}case"scaleY":{let G=j[0]?parseFloat(j[0]):1;A($,"scaleY",G);break}case"scaleZ":{let G=j[0]?parseFloat(j[0]):1;A($,"scaleZ",G);break}case"rotate":A($,"rotate",j[0]?r(j[0]):0,"deg");break;case"rotateX":A($,"rotateX",j[0]?r(j[0]):0,"deg");break;case"rotateY":A($,"rotateY",j[0]?r(j[0]):0,"deg");break;case"rotateZ":A($,"rotateZ",j[0]?r(j[0]):0,"deg");break;case"skew":{let G=j[0]?r(j[0]):0,z=j[1]?r(j[1]):0;A($,"skewX",G,"deg"),A($,"skewY",z,"deg");break}case"skewX":A($,"skewX",j[0]?r(j[0]):0,"deg");break;case"skewY":A($,"skewY",j[0]?r(j[0]):0,"deg");break;case"perspective":{let G=j[0]?g(j[0]):{value:0,unit:""};A($,"perspective",G.value,G.unit);break}default:break}}}function r0(J,$,Q,q,Z,j,G,z,W,B,N,_,X,H){if(X){let Q0=Math.hypot(J,$),N6=J*Z-$*q,B6=Q0!==0?N6/Q0:0,_6=Q0!==0?Math.atan2($,J):0,IJ=Q0!==0?Math.atan2(J*q+$*Z,Q0*Q0):0;if(A(H,"x",B,"px"),A(H,"y",N,"px"),A(H,"scaleX",Q0||1),A(H,"scaleY",B6||1),A(H,"rotate",G0(_6,"rad"),"deg"),Math.abs(IJ)>0.000001)A(H,"skewX",G0(IJ,"rad"),"deg");return}let Y=Math.hypot(J,$,Q)||1,F=Math.hypot(q,Z,j)||1,K=Math.hypot(G,z,W)||1,L=J/Y,k=$/Y,M=Q/Y,O=q/F,T=Z/F,l0=j/F,AJ=G/K,G6=z/K,z6=W/K,o0=Math.sqrt(L*L+O*O),W6=o0<0.000001,i0=0,n0=0,a0=0;if(!W6)i0=Math.atan2(G6,z6),n0=Math.atan2(-AJ,o0),a0=Math.atan2(O,L);else i0=Math.atan2(-l0,T),n0=Math.atan2(-AJ,o0),a0=0;A(H,"x",B,"px"),A(H,"y",N,"px"),A(H,"z",_,"px"),A(H,"scaleX",Y),A(H,"scaleY",F),A(H,"scaleZ",K),A(H,"rotateX",G0(i0,"rad"),"deg"),A(H,"rotateY",G0(n0,"rad"),"deg"),A(H,"rotateZ",G0(a0,"rad"),"deg")}function Y6(J,$){if(!J||J==="none")return;if(typeof DOMMatrixReadOnly<"u"){let q=new DOMMatrixReadOnly(J);r0(q.m11,q.m12,q.m13,q.m21,q.m22,q.m23,q.m31,q.m32,q.m33,q.m41,q.m42,q.m43,q.is2D,$);return}let Q=J.match(/[-+]?\d*\.?\d+(?:e[-+]?\d+)?/gi)||[];if(J.startsWith("matrix3d")&&Q.length>=16){let q=Q.map(Number);r0(q[0],q[1],q[2],q[4],q[5],q[6],q[8],q[9],q[10],q[12],q[13],q[14],!1,$);return}if(J.startsWith("matrix")&&Q.length>=6){let q=Q.map(Number);r0(q[0],q[1],0,q[2],q[3],0,0,0,1,q[4],q[5],0,!0,$)}}function X6(J,$){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let q=J.style.transform;if(q&&q!=="none"){H6(q,$),$.cachedString=q;return}try{if(typeof window<"u"&&window.getComputedStyle){let Z=window.getComputedStyle(J),j=Z.transform||Z.getPropertyValue("transform");if(j&&j!=="none")Y6(j,$),$.cachedString=j}}catch{}}function RJ(J){let $=z0.get(J);if(!$){let Q=new Float32Array(14);Q[8]=1,Q[9]=1,Q[10]=1,Q[11]=1,$={values:Q,units:[...DJ],dirty:0,used:0,cachedString:"",pinDirty:!1},X6(J,$),z0.set(J,$)}return $}function P(J,$,Q,q){let Z=RJ(J),j=e0[$];if(j!==void 0){if(Z.values[j]=Q,q!==void 0)Z.units[j]=q;if(Z.used|=1<<j,$==="scale")Z.values[9]=Q,Z.values[10]=Q,Z.dirty|=1536;else if($==="scaleX"||$==="scaleY")Z.values[8]=1,Z.dirty|=256;if($==="rotate")Z.values[7]=0,Z.dirty|=128;else if($==="rotateZ")Z.values[4]=0,Z.dirty|=16;Z.dirty|=1<<j}}function JJ(J,$){let Q=RJ(J),q=e0[$];if(q===void 0)return $.startsWith("scale")?1:0;if($==="scale"){if(Q.values[q]!==1)return Q.values[q];let Z=Q.values[9],j=Q.values[10];if(Math.abs(Z-j)<0.000001&&Z!==1)return Z;return Q.values[q]}if($==="rotate"){if(Q.values[q]!==0)return Q.values[q];let Z=Q.values[7];if(Z!==0&&Q.values[5]===0&&Q.values[6]===0)return Z;return Q.values[q]}return Q.values[q]}function t0(J){return J===0?"0":`${Math.round(J)}px`}function kJ(J,$,Q){return`translate3d(${t0(J)}, ${t0($)}, ${t0(Q)})`}function R0(J,$,Q,q){D0.set(J,{x:$,y:Q,z:q});let Z=z0.get(J);if(Z)Z.pinDirty=!0}function W0(J){let $=D0.has(J);if(D0.delete(J),$){let Q=z0.get(J);if(Q)Q.pinDirty=!0}}function R(J){let $=z0.get(J),Q=D0.get(J);if(!$){if(Q&&(Q.x!==0||Q.y!==0||Q.z!==0))return kJ(Q.x,Q.y,Q.z);return""}if($.dirty===0&&!$.pinDirty&&$.cachedString)return $.cachedString;let{values:q,units:Z}=$;D.length=0;let j=$.used,G=q[0];if(G!==0){let O=Z[0];D.push(`perspective(${G}${O})`)}let z=q[1],W=q[2],B=q[3],N=Z[1],_=Z[2],X=Z[3],H=j&2,Y=j&4,F=j&8;if(z!==0||W!==0||B!==0||H||Y||F){let O=N===_&&(B===0&&!F||_===X);if(B!==0||F)if(O)D.push(`translate3d(${z}${N}, ${W}${_}, ${B}${X})`);else{if(z!==0||H)D.push(`translateX(${z}${N})`);if(W!==0||Y)D.push(`translateY(${W}${_})`);D.push(`translateZ(${B}${X})`)}else if(O&&(z!==0||H)&&(W!==0||Y))D.push(`translate(${z}${N}, ${W}${_})`);else{if(z!==0||H)D.push(`translateX(${z}${N})`);if(W!==0||Y)D.push(`translateY(${W}${_})`)}}if(q[4]!==0||j&16)D.push(`rotate(${q[4]}deg)`);if(q[5]!==0||j&32)D.push(`rotateX(${q[5]}deg)`);if(q[6]!==0||j&64)D.push(`rotateY(${q[6]}deg)`);if(q[7]!==0||j&128)D.push(`rotateZ(${q[7]}deg)`);let K=j&256,L=j&512,k=j&1024;if(q[8]!==1||K)D.push(`scale(${q[8]})`);else if(q[9]!==1||q[10]!==1||L||k)D.push(`scaleX(${q[9]})`),D.push(`scaleY(${q[10]})`);if(q[11]!==1||j&2048)D.push(`scaleZ(${q[11]})`);if(q[12]!==0||j&4096)D.push(`skewX(${q[12]}deg)`);if(q[13]!==0||j&8192)D.push(`skewY(${q[13]}deg)`);let M=D.join(" ");if(Q&&(Q.x!==0||Q.y!==0||Q.z!==0)){let O=kJ(Q.x,Q.y,Q.z);$.cachedString=M?`${O} ${M}`:O}else $.cachedString=M;return $.dirty=0,$.pinDirty=!1,$.cachedString}function S(J,$=!1){if(z0.delete(J),$&&J instanceof HTMLElement)J.style.transform=""}var $J=new Set,E0=new Map,b0=!1;function x0(J){$J.add(J),b0=!0}function V0(J,$,Q){let q=E0.get(J);if(!q)q=new Map,E0.set(J,q);q.set($,Q),b0=!0}function QJ(){if(!b0)return;for(let J of $J){let $=J;if($.style){let Q=R(J);$.style.transform=Q}}$J.clear();for(let[J,$]of E0){let Q=J;if(Q.style)for(let[q,Z]of $)try{if(q.startsWith("--"))Q.style.setProperty(q,Z);else Q.style[q]=Z}catch{}}E0.clear(),b0=!1}var q0=!1;function N0(){return q0}function qJ(J){if(q0){J();return}q0=!0;try{J(),QJ()}finally{q0=!1}}class V{static instance;listeners=[];_listenersDirty=!0;_listenersSnapshot=[];_isRunning=!1;rafId=null;lastTime=0;elapsedTime=0;lagThreshold=500;maxDelta=33;fpsFrames=0;fpsTime=0;currentFPS=60;lastFrameTime=0;constructor(){}static getInstance(){if(!V.instance)V.instance=new V;return V.instance}add(J,$=0){let Q=this.listeners.findIndex((q)=>q.callback===J);if(Q!==-1)this.listeners[Q].priority=$;else this.listeners.push({callback:J,priority:$});if(this.listeners.sort((q,Z)=>Z.priority-q.priority),this._listenersDirty=!0,!this._isRunning&&this.listeners.length>0)this.start()}remove(J){let $=this.listeners.findIndex((Q)=>Q.callback===J);if($!==-1)this.listeners.splice($,1),this._listenersDirty=!0;if(this.listeners.length===0&&this._isRunning)this.stop()}start(){if(this._isRunning)return;if(typeof requestAnimationFrame>"u"){this._isRunning=!1;return}this._isRunning=!0,this.lastTime=performance.now(),this.rafId=requestAnimationFrame(this.tick)}stop(){if(!this._isRunning)return;if(this._isRunning=!1,this.rafId!==null&&typeof cancelAnimationFrame<"u")cancelAnimationFrame(this.rafId),this.rafId=null}pause(){this.stop()}resume(){if(this.listeners.length>0)this.start()}tick=()=>{if(!this._isRunning)return;let J=performance.now(),$=J-this.lastTime;if($>this.lagThreshold)$=this.maxDelta,this.lastTime=J-$;else this.lastTime=J;let Q=$/1000;if(this.elapsedTime+=Q,this.lastFrameTime=$,this.updateFPS($),q0=!0,this._listenersDirty)this._listenersSnapshot=[...this.listeners],this._listenersDirty=!1;for(let q of this._listenersSnapshot)try{q.callback(Q,this.elapsedTime)}catch(Z){console.error("[Motion] Uncaught error in animation callback:",Z)}try{QJ()}catch(q){console.error("[Motion] Uncaught error in render batch flush:",q)}if(q0=!1,typeof requestAnimationFrame<"u")this.rafId=requestAnimationFrame(this.tick)};updateFPS(J){if(this.fpsFrames++,this.fpsTime+=J,this.fpsTime>=1000)this.currentFPS=Math.round(this.fpsFrames*1000/this.fpsTime),this.fpsFrames=0,this.fpsTime=0}getFPS(){return this.currentFPS}getLastDelta(){return this.lastFrameTime}isRunning(){return this._isRunning}isInTick(){return q0}getListenerCount(){return this.listeners.length}removeAll(){this.listeners=[],this.stop()}}var l=null,B0=null,K6=100,s=new Map;function U6(J){let $=s.get(J);if($!==void 0)s.delete(J),s.set(J,$);return $}function F6(J,$){if(s.has(J))s.delete(J);while(s.size>=K6){let Q=s.keys().next().value;if(Q!==void 0)s.delete(Q);else break}s.set(J,$)}function A6(J){return/^\s*[Mm]/.test(J)}function EJ(){if(B0)return B0;if(typeof document>"u")throw Error("PathParser requires a browser environment");return l=document.createElementNS("http://www.w3.org/2000/svg","svg"),l.style.cssText="position:absolute;width:0;height:0;overflow:hidden;visibility:hidden;",l.setAttribute("aria-hidden","true"),B0=document.createElementNS("http://www.w3.org/2000/svg","path"),l.appendChild(B0),document.body.appendChild(l),B0}function bJ(J){if(J instanceof Element)return J.getAttribute("d");if(typeof J==="string"){if(A6(J))return J;if(typeof document<"u"){let $=document.querySelector(J);if($)return $.getAttribute("d")}}return null}function xJ(J){let $=U6(J);if($!==void 0)return $;try{let Q=EJ();Q.setAttribute("d",J);let q=Q.getTotalLength();return F6(J,q),q}catch{return 0}}function ZJ(J,$,Q=!1){try{let q=EJ();q.setAttribute("d",J);let Z=q.getTotalLength(),j=Math.max(0,Math.min(1,$)),G=Z*j,z=q.getPointAtLength(G),W=0;if(Q)W=I6(q,G,Z);return{x:z.x,y:z.y,angle:W}}catch{return{x:0,y:0,angle:0}}}function I6(J,$,Q){let q=Math.min(0.1,Q*0.001),Z=Math.max(0,$-q),j=Math.min(Q,$+q),G=J.getPointAtLength(Z),z=J.getPointAtLength(j),W=z.x-G.x,B=z.y-G.y;return Math.atan2(B,W)*(180/Math.PI)}function VJ(J,$=[50,50]){if(!J)return{x:0,y:0};let Q=null;if(J instanceof Element)Q=J;else if(typeof J==="string"&&typeof document<"u")Q=document.querySelector(J);if(!Q||typeof Q.getBoundingClientRect!=="function")return{x:0,y:0};let q=Q.getBoundingClientRect(),Z=q.width*$[0]/100,j=q.height*$[1]/100;return{x:Z,y:j}}function CJ(J,$,Q){if(!J)return{x:0,y:0};let q=null;if(J instanceof Element)q=J;else if(typeof J==="string"&&typeof document<"u")q=document.querySelector(J);if(!q)return{x:0,y:0};let Z=ZJ($,0,!1);if(Q&&Q instanceof HTMLElement){let j=Q.style.transform,G=j&&j!=="none"&&j!=="";if(G)Q.style.transform="none";let z=Q.getBoundingClientRect(),W=q.getBoundingClientRect();if(G)Q.style.transform=j;let B=W.left+W.width/2-(z.left+z.width/2),N=W.top+W.height/2-(z.top+z.height/2);return{x:B-Z.x,y:N-Z.y}}return{x:-Z.x,y:-Z.y}}function wJ(){if(l&&l.parentNode)l.parentNode.removeChild(l);l=null,B0=null,s.clear()}var O6=new Set(["perspective","x","y","z","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skewX","skewY"]),L6=new Set(["perspective","x","y","z","width","height","top","left","right","bottom","margin","marginTop","marginRight","marginBottom","marginLeft","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","borderRadius","fontSize","lineHeight"]),M6=new Set(["rotate","rotateX","rotateY","rotateZ","skewX","skewY"]),k6=new Set(["opacity","scale","scaleX","scaleY","scaleZ","z-index","zIndex"]),D6=new Set(["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor","textDecorationColor","caretColor","fill","stroke"]),R6=new Set(["red","green","blue","yellow","orange","purple","pink","cyan","magenta","white","black","gray","grey","transparent","crimson","gold","silver","navy","teal","maroon","olive","lime","aqua","fuchsia","coral","salmon","tomato","indigo"]);function y(J){return O6.has(J)}function Z0(J){return D6.has(J)}function a(J){return J==="filter"}function jJ(J){return J==="drawSVG"}function GJ(J){return J==="path"}function j0(J){return J.startsWith("--")}function PJ(J){if(typeof J!=="string")return!1;let $=J.trim().toLowerCase();if($.startsWith("#"))return!0;if(/^(rgb|rgba|hsl|hsla)\s*\(/.test($))return!0;let Q=U.color;if(Q)return Q.parseColor($)!==null;return R6.has($)}function c(J){if(typeof J==="number"){if(isNaN(J)||!isFinite(J))return console.warn(`[Motion] Property value is ${J}. This property will not animate correctly.`),{value:0,unit:""};return{value:J,unit:""}}if(typeof J==="string"){let $=J.match(/^([+\-*/])=(.+)/);if($){let q=$[2].match(/([-+]?[\d.]+(?:e[-+]?\d+)?)([a-z%]*)/i);if(q)return{value:parseFloat(q[1]),unit:q[2]||""}}let Q=J.match(/([-+]?[\d.]+(?:e[-+]?\d+)?)([a-z%]*)/i);if(Q)return{value:parseFloat(Q[1]),unit:Q[2]||""}}return{value:0,unit:""}}function t(J){if(k6.has(J))return"";if(M6.has(J))return"deg";if(L6.has(J))return"px";return""}function SJ(J){if(J==="opacity")return 1;if(J.startsWith("scale"))return 1;return 0}function n(J,$){if(!(J instanceof Element)){let Q=J;if($ in Q)return Q[$];return E6($)}if(y($))return JJ(J,$);try{if(typeof window<"u"&&window.getComputedStyle){let q=window.getComputedStyle(J).getPropertyValue(o($));if(q)return c(q).value}}catch(Q){}return SJ($)}function yJ(J,$){let Q=J,q=o($);if(y($)){let Z=Q.style.transform;S(J),Q.style.transform="";let j=JJ(J,$);return Q.style.transform=Z,S(J),{value:j,unit:t($)}}try{if(typeof window<"u"&&window.getComputedStyle){let Z=Q.style.getPropertyValue(q);Q.style.removeProperty(q);let G=window.getComputedStyle(J).getPropertyValue(q);if(Z)Q.style.setProperty(q,Z);if(G){let z=c(G);return{value:z.value,unit:z.unit}}}}catch(Z){}return{value:SJ($),unit:t($)}}function E6(J){if(J.startsWith("scale"))return 1;return 0}function o(J){return J.replace(/[A-Z]/g,($)=>`-${$.toLowerCase()}`)}function b6(J){if(typeof J==="string")return/^[+\-*/]=/.test(J);return!1}function x6(J){let $=J.match(/^([+\-*/])=/);return $?$[0]:null}function V6(J,$,Q){switch(Q){case"+=":return J+$;case"-=":return J-$;case"*=":return J*$;case"/=":return $!==0?J/$:J;default:return $}}function C6(J,$,Q,q){let Z=U.color;if(!Z)return null;let j=String(Q),G=j===""?Z.getCurrentColor(J,$):Z.parseColor(j,J),z=q!==void 0?Z.parseColor(String(q),J):Z.getCurrentColor(J,$);return{type:"color",property:$,isTransform:!1,startColor:z||new Float32Array([0,0,0,1]),endColor:G||new Float32Array([0,0,0,1])}}function w6(J,$,Q,q){let Z=U.filter;if(!Z)return null;let j=String(Q),G=j===""?Z.getCurrentFilter(J):Z.parseFilter(j),z=q!==void 0?Z.parseFilter(String(q)):Z.getCurrentFilter(J);z=z||[],G=G||[];let W=Z.mergeFilterArrays(z,G);return{type:"filter",property:$,isTransform:!1,startFilters:W.start,endFilters:W.end}}function P6(J,$,Q,q){if(PJ(Q)||q!==void 0&&PJ(q)){let z=U.color;if(z){let W=String(Q),B=z.parseColor(W,J),N=q!==void 0?z.parseColor(String(q),J):S6(J,$);return{type:"color",property:$,isTransform:!1,startColor:N||new Float32Array([0,0,0,1]),endColor:B||new Float32Array([0,0,0,1])}}}let j=c(Q),G;if(q!==void 0)G=c(q).value;else G=y6(J,$);return{type:"scalar",property:$,isTransform:!1,startValue:G,endValue:j.value,unit:j.unit}}function S6(J,$){let Q=U.color;if(!Q)return null;try{if(typeof window<"u"&&window.getComputedStyle){let Z=window.getComputedStyle(J).getPropertyValue($).trim();if(Z)return Q.parseColor(Z,J)}}catch{}return null}function y6(J,$){try{if(typeof window<"u"&&window.getComputedStyle){let q=window.getComputedStyle(J).getPropertyValue($).trim();if(q)return c(q).value}}catch{}return 0}function v6(J,$,Q,q){let Z=U.drawSVG;if(!Z)return null;let j=Z.getPathLength(J),G=Z.parseDrawSVG(Q,J)||{start:0,end:1},z=q!==void 0?Z.parseDrawSVG(q,J)||{start:0,end:1}:Z.getCurrentDrawSVG(J);return{type:"drawSVG",property:$,isTransform:!1,startDraw:z,endDraw:G,length:j}}function h6(J,$,Q,q){let Z=Q,j=q,G=Z?.target?Z:j;if(!G?.target)return null;let z=bJ(G.target);if(!z)return null;let W=xJ(z);if(W===0)return null;let B,N;if(Z?.target&&j?.target)B=j.start??0,N=Z.end??1;else if(Z?.target)B=Z.start??0,N=Z.end??1;else B=j.start??0,N=j.end??1;let _=Z?.rotate??j?.rotate??!1,X=Z?.alignAt??j?.alignAt??[50,50],H=VJ(J,X),Y=Z?.align??j?.align,F=CJ(Y,z,J);return{type:"path",property:$,isTransform:!1,pathData:z,pathLength:W,startProgress:B,endProgress:N,rotate:_,alignOffset:H,pathOffset:F}}function vJ(J,$,Q,q){let Z=J instanceof Element;if(Z&&j0($))return P6(J,$,Q,q);if(Z&&Z0($)){let N=C6(J,$,Q,q);if(N)return N}if(Z&&a($)){let N=w6(J,$,Q,q);if(N)return N}if(Z&&jJ($)){let N=v6(J,$,Q,q);if(N)return N}if(Z&&GJ($)){let N=h6(J,$,Q,q);if(N)return N}let j=y($),G=q===void 0&&b6(Q),z,W,B;if(q!==void 0){let N=c(q),_=c(Q);z=N.value,W=_.value,B=_.unit||N.unit||t($)}else if(G){let N=x6(Q),_=n(J,$),X=c(Q);z=_,W=V6(_,X.value,N),B=X.unit||t($)}else{let N=n(J,$),_=c(Q);z=N,W=_.value,B=_.unit||t($)}return{type:"scalar",property:$,isTransform:j,startValue:z,endValue:W,unit:B}}function hJ(){let J=new WeakMap;return{register($,Q){let q=J.get($);if(!q)q=new Set,J.set($,q);q.add(Q)},registerMany($,Q){for(let q of Q)this.register($,q)},get($){return J.get($)},clearRegistry($){J.delete($)}}}var zJ=hJ(),C0=new WeakMap,WJ=hJ();function TJ(J){if(y(J))return["transform"];if(a(J))return["filter"];if(jJ(J))return["strokeDasharray","strokeDashoffset"];return[J]}function T6(J,$){if(y($)&&!C0.has(J)){if(J instanceof HTMLElement||J instanceof SVGElement){let q=J.style.transform;C0.set(J,q||null)}}let Q=TJ($);for(let q of Q)zJ.register(J,q)}function f6(J,$){for(let Q of $)T6(J,Q)}function u6(J){zJ.clearRegistry(J),C0.delete(J)}function d6(J,$){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let Q=new Set;for(let q of $)for(let Z of TJ(q))Q.add(Z);for(let q of Q)if(j0(q))J.style.removeProperty(q);else J.style[q]=""}function p6(J){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let $=zJ.get(J);if(!$||$.size===0)return;for(let Q of $){if(Q==="transform"){let q=C0.get(J);if(q!==void 0){if(q)J.style.transform=q;else J.style.removeProperty("transform");continue}}if(j0(Q))J.style.removeProperty(Q);else J.style[Q]=""}}function c6(J){p6(J),u6(J)}function U0(J,$){WJ.registerMany(J,$)}function NJ(J){WJ.clearRegistry(J)}function m6(J){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let $=WJ.get(J);if(!$||$.size===0)return;for(let Q of $)J.style[Q]=""}function g6(J){m6(J),NJ(J)}U.styleReset={registerAnimatedProps:f6,clearAnimationStylesForProps:d6,clearAnimationStylesAndUnregister:c6,clearPinStylesAndUnregister:g6};class C{static _registry=new Map;static _users=new Map;static getOrCreate(J,$){let Q=C._registry.get($);if(!Q)Q=new C(J),C._registry.set($,Q);let q=C._users.get($);if(!q)q=new Set,C._users.set($,q);return q.add(J),Q}static release(J,$){let Q=C._users.get($);if(!Q)return;if(Q.delete(J),Q.size===0){let q=C._registry.get($);C._registry.delete($),C._users.delete($),q?.cleanup()}}_id;_element=null;_originalStyles=null;_spacer=null;_currentState="before";_pinStart=0;_pinEnd=0;_pinDistance=0;_useFixedPin=!1;_pinSpacing;_elementHeight=0;_fixedTop=0;_fixedLeft=0;_width=0;_fixedBreakingAncestors=[];_isBodyPin=!1;_originalHtmlHeight="";_originalHtmlOverflow="";constructor(J){this._id=J}setup(J,$,Q,q,Z,j){if(typeof document>"u")return;this._isBodyPin=J===document.body,this._element=J,this._pinStart=$,this._pinEnd=Q;let G=this._pinDistance;this._pinDistance=Q-$,this._useFixedPin=Z,this._pinSpacing=j;let z=this._isBodyPin?this._originalStyles!==null:this._spacer!==null;if(z&&this._currentState==="pinned"&&Z)this._updateFixed("before");if(z&&this._spacer)this._spacer.style.width="";let W=z&&this._isBodyPin?document.documentElement.style.height:null;if(W!==null)document.documentElement.style.height=this._originalHtmlHeight;let B=J.getBoundingClientRect();if(W!==null)document.documentElement.style.height=W;let N=z&&this._spacer?window.getComputedStyle(this._spacer):window.getComputedStyle(J);if(this._elementHeight=B.height,!z)this._originalStyles={position:J.style.position,top:J.style.top,left:J.style.left,width:J.style.width,marginTop:J.style.marginTop,marginBottom:J.style.marginBottom,marginLeft:J.style.marginLeft,marginRight:J.style.marginRight,zIndex:J.style.zIndex};if(Z)if(this._fixedTop=q,this._isBodyPin){if(this._fixedLeft=B.left,this._width=B.width,!z)this._originalHtmlHeight=document.documentElement.style.height,this._originalHtmlOverflow=document.documentElement.style.overflow,this._detectFixedBreakingAncestors(J);document.documentElement.style.height=`${this._elementHeight+this._pinDistance}px`}else{let _=this._resolvePinSpacing(),H=`
|
|
2
|
-
display: ${
|
|
1
|
+
function S(J,$){switch(J){case"play":case"resume":$.play();break;case"pause":$.pause();break;case"reverse":$.reverse();break;case"restart":$.restart();break;case"reset":$.pause(),$.progress(0);break;case"complete":$.progress(1),$.pause();break;case"none":break;default:console.warn(`[Motion] Unknown timeline action: "${J}". Valid actions: play, pause, resume, reverse, restart, reset, complete, none`)}}var U={color:null,filter:null,drawSVG:null,stagger:null,textSplitter:null,triggerManager:null,styleReset:null,fit:null};class L{static _instance;static _triggerRegistry=new Map;static _pageLoadTriggerFactory=null;static _RESIZE_DEBOUNCE_MS=200;_pageLoadTrigger=null;_scrollTriggers=new Map;_eventTriggers=new Map;_mouseMoveTriggers=new Map;_gestureTriggers=new Map;_cursorTriggers=new Map;_pageExitTriggers=new Map;_resizeHandler=null;_resizeTimer=null;get _allTriggerMaps(){return[this._scrollTriggers,this._eventTriggers,this._mouseMoveTriggers,this._gestureTriggers,this._cursorTriggers,this._pageExitTriggers]}constructor(){}static getInstance(){if(!L._instance)L._instance=new L;return L._instance}static registerTrigger(J,$){L._triggerRegistry.set(J,$)}static registerPageLoadTrigger(J){L._pageLoadTriggerFactory=J}_getPageLoadTrigger(){if(!this._pageLoadTrigger&&L._pageLoadTriggerFactory)this._pageLoadTrigger=new L._pageLoadTriggerFactory;return this._pageLoadTrigger}_createTrigger(J,...$){let Q=L._triggerRegistry.get(J);if(!Q){let Z=Array.from(L._triggerRegistry.keys());return console.warn(`[Motion SDK] Trigger type '${J}' is not available in this bundle. Available triggers: ${Z.join(", ")||"none"}. Animations using .on${J.charAt(0).toUpperCase()+J.slice(1)}() will be skipped.`),null}return new Q(...$)}registerPageLoad(J,$){this.unregister(J);let Q=this._getPageLoadTrigger();if(Q)Q.register(J,$)}_attachResizeListener(){if(this._resizeHandler||typeof window>"u")return;this._resizeHandler=()=>{if(this._resizeTimer!==null)clearTimeout(this._resizeTimer);this._resizeTimer=setTimeout(()=>{this._resizeTimer=null,this.refreshScrollTriggers()},L._RESIZE_DEBOUNCE_MS)},window.addEventListener("resize",this._resizeHandler,{passive:!0})}_detachResizeListener(){if(!this._resizeHandler||typeof window>"u")return;if(window.removeEventListener("resize",this._resizeHandler),this._resizeTimer!==null)clearTimeout(this._resizeTimer),this._resizeTimer=null;this._resizeHandler=null}registerScroll(J,$){this.unregister(J);let Q=this._createTrigger("scroll",J,$);if(!Q)return;this._scrollTriggers.set(J,Q),J._trigger=Q,Q.enable(),this._attachResizeListener()}registerHover(J,$){this.unregister(J);let Q=this._createTrigger("event",J,{type:"hover",target:$.target,onLeave:$.onLeave,leaveDelay:$.leaveDelay});if(!Q)return;this._eventTriggers.set(J,Q),J._trigger=Q,Q.enable()}registerClick(J,$){this.unregister(J);let Q=this._createTrigger("event",J,{type:"click",target:$.target,secondTarget:$.secondTarget,toggle:$.toggle,preventDefault:$.preventDefault});if(!Q)return;this._eventTriggers.set(J,Q),J._trigger=Q,Q.enable()}registerMouseMove(J,$){this.unregister(J);let Q=this._createTrigger("mouseMove",J,$);if(!Q)return;this._mouseMoveTriggers.set(J,Q),J._trigger=Q,Q.enable()}registerGesture(J,$){this.unregister(J);let Q=this._createTrigger("gesture",J,$);if(!Q)return;this._gestureTriggers.set(J,Q),J._trigger=Q,Q.enable()}registerCursor(J,$){this.unregister(J);let Q=this._createTrigger("cursor",J,$);if(!Q)return;this._cursorTriggers.set(J,Q),J._trigger=Q,Q.enable()}registerPageExit(J,$){this.unregister(J);let Q=this._createTrigger("pageExit",J,$);if(!Q)return;this._pageExitTriggers.set(J,Q),J._trigger=Q,Q.enable()}unregister(J){let $=this._getPageLoadTrigger();if($)$.unregister(J);for(let Q of this._allTriggerMaps){let Z=Q.get(J);if(Z)Z.disable(),Q.delete(J)}if(J._trigger=void 0,this._scrollTriggers.size===0)this._detachResizeListener()}refreshScrollTriggers(){let J=Array.from(this._scrollTriggers.values()),$=typeof window<"u"?window.scrollY:0;J.sort((Q,Z)=>{let j=Q._pinManager?.getLayoutRect?.(),q=Z._pinManager?.getLayoutRect?.();if(!j&&!q)return 0;if(!j)return 1;if(!q)return-1;return j.top+$-(q.top+$)}),J.forEach((Q)=>Q.refresh?.()),this._eventTriggers.forEach((Q)=>Q.refresh?.()),this._gestureTriggers.forEach((Q)=>Q.refresh?.()),this._mouseMoveTriggers.forEach((Q)=>Q.refresh?.())}killAll(){let J=this._getPageLoadTrigger();if(J)J.clear();for(let $ of this._allTriggerMaps)$.forEach((Q)=>Q.disable()),$.clear();this._detachResizeListener()}static _reset(){if(L._instance){if(L._instance._pageLoadTrigger)L._instance._pageLoadTrigger._reset();L._instance.killAll(),L._instance=void 0}}}U.triggerManager={getInstance:L.getInstance};function OJ(J){if(typeof document>"u"){J();return}if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",J,{once:!0});else J()}function FJ(J){if(J===null||typeof J!=="object")return!1;if(J instanceof Element)return!1;if("nodeType"in J)return!1;if("style"in J)return!1;let $=J;if("x"in $&&typeof $.x==="number")return!0;if("length"in J)return!1;return!0}function U0(J){return J instanceof Element||typeof J==="object"&&J!==null&&(("nodeType"in J)||("style"in J))}function D0(J){if(FJ(J))return[J];if(typeof J==="string"){if(typeof document<"u")try{return Array.from(document.querySelectorAll(J))}catch($){return console.warn(`[Motion] Invalid selector "${J}":`,$),[]}return[]}if(J instanceof Element)return[J];if(J&&typeof J==="object"&&"style"in J&&!Array.isArray(J))return[J];if(J instanceof NodeList)return Array.from(J);if(Array.isArray(J)){if(J.length===0)return[];if(typeof J[0]==="string"){if(typeof document>"u")return[];let $=[];for(let Q of J)try{$.push(...Array.from(document.querySelectorAll(Q)))}catch(Z){console.warn(`[Motion] Invalid selector "${Q}":`,Z)}return $}if(FJ(J[0]))return J;return J}if(J&&typeof J==="object"&&"length"in J)return Array.from(J);return[]}class u{_timeline;_config;_enabled=!1;constructor(J,$){this._timeline=J,this._config=$}enable(){if(this._enabled)return;this._enabled=!0,OJ(()=>{if(!this._enabled)return;this._onEnable()})}disable(){if(!this._enabled)return;this._enabled=!1,this._onDisable()}_resolveElement(J,$){if(J===void 0||J===null)return $??null;if(typeof J!=="string")return J;if(typeof document<"u")try{let Q=document.querySelector(J);if(Q!==null)return Q}catch(Q){console.warn(`[Motion] Invalid selector "${J}":`,Q)}return $??null}_resolveElements(J){if(J===void 0||J===null)return[];if(typeof J!=="string")return[J];if(typeof document<"u")try{let $=document.querySelectorAll(J);return Array.from($)}catch($){return console.warn(`[Motion] Invalid selector "${J}":`,$),[]}return[]}_cleanupListenerMap(J){J.forEach(($,Q)=>{$.forEach((Z,j)=>{Q.removeEventListener(j,Z)})}),J.clear()}}function d(J){let $=J,Q=$.style.transform,Z=$.style.transition;$.style.transition="none",$.style.transform="none";let j=!1,q=$.style.position,G=$.style.top,z=$.style.left,W=$.style.width;if(q==="fixed")j=!0;else if(q===""||q===void 0){if(typeof window<"u"&&typeof window.getComputedStyle==="function"&&window.getComputedStyle($).position==="fixed")j=!0}if(j)$.style.position="",$.style.top="",$.style.left="",$.style.width="";let N=$.getBoundingClientRect();if($.style.transform=Q,$.style.transition=Z,j)$.style.position=q,$.style.top=G,$.style.left=z,$.style.width=W;return N}class LJ extends u{_targets=[];_secondTargets=[];_listeners=new Map;_isForward=!0;_frozenRects=new Map;_snapshotScrollX=0;_snapshotScrollY=0;_wasHovering=!1;_hoverLeaveTimeout=null;_boundMouseMoveHandler=null;constructor(J,$){super(J,$)}_onEnable(){if(this._resolveTargets(),this._config.type==="hover")this._addHoverListeners();else if(this._config.type==="click")this._addClickListeners()}_onDisable(){if(this._boundMouseMoveHandler)window.removeEventListener("mousemove",this._boundMouseMoveHandler),this._boundMouseMoveHandler=null;if(this._hoverLeaveTimeout!==null)clearTimeout(this._hoverLeaveTimeout),this._hoverLeaveTimeout=null;this._frozenRects.clear(),this._wasHovering=!1,this._cleanupListenerMap(this._listeners)}refresh(){if(this._config.type!=="hover")return;this._snapshotRects()}_snapshotRects(){this._snapshotScrollX=window.scrollX||0,this._snapshotScrollY=window.scrollY||0;for(let J of this._targets)this._frozenRects.set(J,d(J))}_resolveTargets(){if(this._targets=this._resolveElements(this._config.target),this._config.secondTarget)this._secondTargets=this._resolveElements(this._config.secondTarget);else this._secondTargets=this._targets}_addHoverListeners(){let J=this._config.onLeave||"reverse",$=this._config.leaveDelay||0;this._snapshotRects(),this._boundMouseMoveHandler=(Q)=>{let Z=(window.scrollX||0)-this._snapshotScrollX,j=(window.scrollY||0)-this._snapshotScrollY,q=Q.clientX+Z,G=Q.clientY+j,z=!1;for(let W of this._frozenRects.values())if(q>=W.left&&q<=W.right&&G>=W.top&&G<=W.bottom){z=!0;break}if(z&&!this._wasHovering){if(this._wasHovering=!0,this._hoverLeaveTimeout!==null)clearTimeout(this._hoverLeaveTimeout),this._hoverLeaveTimeout=null;this._timeline.play()}else if(!z&&this._wasHovering){if(this._wasHovering=!1,J==="none")return;let W=()=>{this._handleLeaveAction(J),this._hoverLeaveTimeout=null};if($>0)this._hoverLeaveTimeout=window.setTimeout(W,$*1000);else W()}},window.addEventListener("mousemove",this._boundMouseMoveHandler)}_handleLeaveAction(J){S(J==="stop"?"reset":J,this._timeline)}_addClickListeners(){let J=this._config.toggle||"play",$=this._config.preventDefault||!1,Q=this._config.secondTarget&&this._config.secondTarget!==this._config.target;if(this._targets.forEach((Z)=>{let j=this._listeners.get(Z)||new Map,q=(G)=>{if($)G.preventDefault();if(!Q)if(this._isForward){if(this._timeline.restart(),J!=="play")this._isForward=!1}else this._handleSecondClick(J),this._isForward=!0;else this._timeline.restart()};Z.addEventListener("click",q),j.set("click",q),this._listeners.set(Z,j)}),Q)this._secondTargets.forEach((Z)=>{if(this._listeners.has(Z))return;let j=new Map,q=(G)=>{if($)G.preventDefault();this._handleSecondClick(J)};Z.addEventListener("click",q),j.set("click",q),this._listeners.set(Z,j)})}_handleSecondClick(J){S(J,this._timeline)}}L.registerTrigger("event",LJ);var t0={perspective:0,x:1,y:2,z:3,rotate:4,rotateX:5,rotateY:6,rotateZ:7,scale:8,scaleX:9,scaleY:10,scaleZ:11,skewX:12,skewY:13},kJ=["px","px","px","px","deg","deg","deg","deg","","","","","deg","deg"],z0=new WeakMap,R0=new WeakMap,D=[];function o(J){let $=J.trim().match(/([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z%]*)/i);if(!$)return{value:0,unit:""};return{value:parseFloat($[1]),unit:$[2]||""}}function G0(J,$){switch($){case"rad":return J*180/Math.PI;case"turn":return J*360;case"grad":return J*0.9;default:return J}}function e(J){let $=o(J);return G0($.value,$.unit||"deg")}function A(J,$,Q,Z){let j=t0[$];if(j===void 0)return;J.values[j]=Q;let q=Z&&Z.length>0?Z:kJ[j]||"";J.units[j]=q,J.used|=1<<j}function H6(J,$){let Q=/([a-zA-Z0-9]+)\(([^)]+)\)/g,Z;while((Z=Q.exec(J))!==null){let j=Z[1],q=Z[2].match(/[-+]?\d*\.?\d+(?:e[-+]?\d+)?[a-z%]*/gi)||[];switch(j){case"translate":{let G=q[0]?o(q[0]):{value:0,unit:""},z=q[1]?o(q[1]):{value:0,unit:""};A($,"x",G.value,G.unit),A($,"y",z.value,z.unit);break}case"translate3d":{let G=q[0]?o(q[0]):{value:0,unit:""},z=q[1]?o(q[1]):{value:0,unit:""},W=q[2]?o(q[2]):{value:0,unit:""};A($,"x",G.value,G.unit),A($,"y",z.value,z.unit),A($,"z",W.value,W.unit);break}case"translateX":{let G=q[0]?o(q[0]):{value:0,unit:""};A($,"x",G.value,G.unit);break}case"translateY":{let G=q[0]?o(q[0]):{value:0,unit:""};A($,"y",G.value,G.unit);break}case"translateZ":{let G=q[0]?o(q[0]):{value:0,unit:""};A($,"z",G.value,G.unit);break}case"scale":{let G=q[0]?parseFloat(q[0]):1,z=q[1]?parseFloat(q[1]):G;A($,"scaleX",G),A($,"scaleY",z);break}case"scale3d":{let G=q[0]?parseFloat(q[0]):1,z=q[1]?parseFloat(q[1]):1,W=q[2]?parseFloat(q[2]):1;A($,"scaleX",G),A($,"scaleY",z),A($,"scaleZ",W);break}case"scaleX":{let G=q[0]?parseFloat(q[0]):1;A($,"scaleX",G);break}case"scaleY":{let G=q[0]?parseFloat(q[0]):1;A($,"scaleY",G);break}case"scaleZ":{let G=q[0]?parseFloat(q[0]):1;A($,"scaleZ",G);break}case"rotate":A($,"rotate",q[0]?e(q[0]):0,"deg");break;case"rotateX":A($,"rotateX",q[0]?e(q[0]):0,"deg");break;case"rotateY":A($,"rotateY",q[0]?e(q[0]):0,"deg");break;case"rotateZ":A($,"rotateZ",q[0]?e(q[0]):0,"deg");break;case"skew":{let G=q[0]?e(q[0]):0,z=q[1]?e(q[1]):0;A($,"skewX",G,"deg"),A($,"skewY",z,"deg");break}case"skewX":A($,"skewX",q[0]?e(q[0]):0,"deg");break;case"skewY":A($,"skewY",q[0]?e(q[0]):0,"deg");break;case"perspective":{let G=q[0]?o(q[0]):{value:0,unit:""};A($,"perspective",G.value,G.unit);break}default:break}}}function a0(J,$,Q,Z,j,q,G,z,W,N,B,_,X,Y){if(X){let Z0=Math.hypot(J,$),B6=J*j-$*Z,_6=Z0!==0?B6/Z0:0,Y6=Z0!==0?Math.atan2($,J):0,AJ=Z0!==0?Math.atan2(J*Z+$*j,Z0*Z0):0;if(A(Y,"x",N,"px"),A(Y,"y",B,"px"),A(Y,"scaleX",Z0||1),A(Y,"scaleY",_6||1),A(Y,"rotate",G0(Y6,"rad"),"deg"),Math.abs(AJ)>0.000001)A(Y,"skewX",G0(AJ,"rad"),"deg");return}let H=Math.hypot(J,$,Q)||1,I=Math.hypot(Z,j,q)||1,K=Math.hypot(G,z,W)||1,F=J/H,M=$/H,k=Q/H,O=Z/I,P=j/I,l0=q/I,IJ=G/K,z6=z/K,W6=W/K,o0=Math.sqrt(F*F+O*O),N6=o0<0.000001,s0=0,i0=0,n0=0;if(!N6)s0=Math.atan2(z6,W6),i0=Math.atan2(-IJ,o0),n0=Math.atan2(O,F);else s0=Math.atan2(-l0,P),i0=Math.atan2(-IJ,o0),n0=0;A(Y,"x",N,"px"),A(Y,"y",B,"px"),A(Y,"z",_,"px"),A(Y,"scaleX",H),A(Y,"scaleY",I),A(Y,"scaleZ",K),A(Y,"rotateX",G0(s0,"rad"),"deg"),A(Y,"rotateY",G0(i0,"rad"),"deg"),A(Y,"rotateZ",G0(n0,"rad"),"deg")}function X6(J,$){if(!J||J==="none")return;if(typeof DOMMatrixReadOnly<"u"){let Z=new DOMMatrixReadOnly(J);a0(Z.m11,Z.m12,Z.m13,Z.m21,Z.m22,Z.m23,Z.m31,Z.m32,Z.m33,Z.m41,Z.m42,Z.m43,Z.is2D,$);return}let Q=J.match(/[-+]?\d*\.?\d+(?:e[-+]?\d+)?/gi)||[];if(J.startsWith("matrix3d")&&Q.length>=16){let Z=Q.map(Number);a0(Z[0],Z[1],Z[2],Z[4],Z[5],Z[6],Z[8],Z[9],Z[10],Z[12],Z[13],Z[14],!1,$);return}if(J.startsWith("matrix")&&Q.length>=6){let Z=Q.map(Number);a0(Z[0],Z[1],0,Z[2],Z[3],0,0,0,1,Z[4],Z[5],0,!0,$)}}function K6(J,$){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let Z=J.style.transform;if(Z&&Z!=="none"){H6(Z,$),$.cachedString=Z;return}try{if(typeof window<"u"&&window.getComputedStyle){let j=window.getComputedStyle(J),q=j.transform||j.getPropertyValue("transform");if(q&&q!=="none")X6(q,$),$.cachedString=q}}catch{}}function DJ(J){let $=z0.get(J);if(!$){let Q=new Float32Array(14);Q[8]=1,Q[9]=1,Q[10]=1,Q[11]=1,$={values:Q,units:[...kJ],dirty:0,used:0,cachedString:"",pinDirty:!1},K6(J,$),z0.set(J,$)}return $}function y(J,$,Q,Z){let j=DJ(J),q=t0[$];if(q!==void 0){if(j.values[q]=Q,Z!==void 0)j.units[q]=Z;if(j.used|=1<<q,$==="scale")j.values[9]=Q,j.values[10]=Q,j.dirty|=1536;else if($==="scaleX"||$==="scaleY")j.values[8]=1,j.dirty|=256;if($==="rotate")j.values[7]=0,j.dirty|=128;else if($==="rotateZ")j.values[4]=0,j.dirty|=16;j.dirty|=1<<q}}function e0(J,$){let Q=DJ(J),Z=t0[$];if(Z===void 0)return $.startsWith("scale")?1:0;if($==="scale"){if(Q.values[Z]!==1)return Q.values[Z];let j=Q.values[9],q=Q.values[10];if(Math.abs(j-q)<0.000001&&j!==1)return j;return Q.values[Z]}if($==="rotate"){if(Q.values[Z]!==0)return Q.values[Z];let j=Q.values[7];if(j!==0&&Q.values[5]===0&&Q.values[6]===0)return j;return Q.values[Z]}return Q.values[Z]}function r0(J){return J===0?"0":`${Math.round(J)}px`}function MJ(J,$,Q){return`translate3d(${r0(J)}, ${r0($)}, ${r0(Q)})`}function E0(J,$,Q,Z){R0.set(J,{x:$,y:Q,z:Z});let j=z0.get(J);if(j)j.pinDirty=!0}function W0(J){let $=R0.has(J);if(R0.delete(J),$){let Q=z0.get(J);if(Q)Q.pinDirty=!0}}function R(J){let $=z0.get(J),Q=R0.get(J);if(!$){if(Q&&(Q.x!==0||Q.y!==0||Q.z!==0))return MJ(Q.x,Q.y,Q.z);return""}if($.dirty===0&&!$.pinDirty&&$.cachedString)return $.cachedString;let{values:Z,units:j}=$;D.length=0;let q=$.used,G=Z[0];if(G!==0){let O=j[0];D.push(`perspective(${G}${O})`)}let z=Z[1],W=Z[2],N=Z[3],B=j[1],_=j[2],X=j[3],Y=q&2,H=q&4,I=q&8;if(z!==0||W!==0||N!==0||Y||H||I){let O=B===_&&(N===0&&!I||_===X);if(N!==0||I)if(O)D.push(`translate3d(${z}${B}, ${W}${_}, ${N}${X})`);else{if(z!==0||Y)D.push(`translateX(${z}${B})`);if(W!==0||H)D.push(`translateY(${W}${_})`);D.push(`translateZ(${N}${X})`)}else if(O&&(z!==0||Y)&&(W!==0||H))D.push(`translate(${z}${B}, ${W}${_})`);else{if(z!==0||Y)D.push(`translateX(${z}${B})`);if(W!==0||H)D.push(`translateY(${W}${_})`)}}if(Z[4]!==0||q&16)D.push(`rotate(${Z[4]}deg)`);if(Z[5]!==0||q&32)D.push(`rotateX(${Z[5]}deg)`);if(Z[6]!==0||q&64)D.push(`rotateY(${Z[6]}deg)`);if(Z[7]!==0||q&128)D.push(`rotateZ(${Z[7]}deg)`);let K=q&256,F=q&512,M=q&1024;if(Z[8]!==1||K)D.push(`scale(${Z[8]})`);else if(Z[9]!==1||Z[10]!==1||F||M)D.push(`scaleX(${Z[9]})`),D.push(`scaleY(${Z[10]})`);if(Z[11]!==1||q&2048)D.push(`scaleZ(${Z[11]})`);if(Z[12]!==0||q&4096)D.push(`skewX(${Z[12]}deg)`);if(Z[13]!==0||q&8192)D.push(`skewY(${Z[13]}deg)`);let k=D.join(" ");if(Q&&(Q.x!==0||Q.y!==0||Q.z!==0)){let O=MJ(Q.x,Q.y,Q.z);$.cachedString=k?`${O} ${k}`:O}else $.cachedString=k;return $.dirty=0,$.pinDirty=!1,$.cachedString}function v(J,$=!1){if(z0.delete(J),$&&J instanceof HTMLElement)J.style.transform=""}var JJ=new Set,b0=new Map,x0=!1;function C0(J){JJ.add(J),x0=!0}function V0(J,$,Q){let Z=b0.get(J);if(!Z)Z=new Map,b0.set(J,Z);Z.set($,Q),x0=!0}function $J(){if(!x0)return;for(let J of JJ){let $=J;if($.style){let Q=R(J);$.style.transform=Q}}JJ.clear();for(let[J,$]of b0){let Q=J;if(Q.style)for(let[Z,j]of $)try{if(Z.startsWith("--"))Q.style.setProperty(Z,j);else Q.style[Z]=j}catch{}}b0.clear(),x0=!1}var j0=!1;function N0(){return j0}function QJ(J){if(j0){J();return}j0=!0;try{J(),$J()}finally{j0=!1}}class C{static instance;listeners=[];_listenersDirty=!0;_listenersSnapshot=[];_isRunning=!1;rafId=null;lastTime=0;elapsedTime=0;lagThreshold=500;maxDelta=33;fpsFrames=0;fpsTime=0;currentFPS=60;lastFrameTime=0;constructor(){}static getInstance(){if(!C.instance)C.instance=new C;return C.instance}add(J,$=0){let Q=this.listeners.findIndex((Z)=>Z.callback===J);if(Q!==-1)this.listeners[Q].priority=$;else this.listeners.push({callback:J,priority:$});if(this.listeners.sort((Z,j)=>j.priority-Z.priority),this._listenersDirty=!0,!this._isRunning&&this.listeners.length>0)this.start()}remove(J){let $=this.listeners.findIndex((Q)=>Q.callback===J);if($!==-1)this.listeners.splice($,1),this._listenersDirty=!0;if(this.listeners.length===0&&this._isRunning)this.stop()}start(){if(this._isRunning)return;if(typeof requestAnimationFrame>"u"){this._isRunning=!1;return}this._isRunning=!0,this.lastTime=performance.now(),this.rafId=requestAnimationFrame(this.tick)}stop(){if(!this._isRunning)return;if(this._isRunning=!1,this.rafId!==null&&typeof cancelAnimationFrame<"u")cancelAnimationFrame(this.rafId),this.rafId=null}pause(){this.stop()}resume(){if(this.listeners.length>0)this.start()}tick=()=>{if(!this._isRunning)return;let J=performance.now(),$=J-this.lastTime;if($>this.lagThreshold)$=this.maxDelta,this.lastTime=J-$;else this.lastTime=J;let Q=$/1000;if(this.elapsedTime+=Q,this.lastFrameTime=$,this.updateFPS($),j0=!0,this._listenersDirty)this._listenersSnapshot=[...this.listeners],this._listenersDirty=!1;for(let Z of this._listenersSnapshot)try{Z.callback(Q,this.elapsedTime)}catch(j){console.error("[Motion] Uncaught error in animation callback:",j)}try{$J()}catch(Z){console.error("[Motion] Uncaught error in render batch flush:",Z)}if(j0=!1,typeof requestAnimationFrame<"u")this.rafId=requestAnimationFrame(this.tick)};updateFPS(J){if(this.fpsFrames++,this.fpsTime+=J,this.fpsTime>=1000)this.currentFPS=Math.round(this.fpsFrames*1000/this.fpsTime),this.fpsFrames=0,this.fpsTime=0}getFPS(){return this.currentFPS}getLastDelta(){return this.lastFrameTime}isRunning(){return this._isRunning}isInTick(){return j0}getListenerCount(){return this.listeners.length}removeAll(){this.listeners=[],this.stop()}}var i=null,B0=null,U6=100,s=new Map;function I6(J){let $=s.get(J);if($!==void 0)s.delete(J),s.set(J,$);return $}function A6(J,$){if(s.has(J))s.delete(J);while(s.size>=U6){let Q=s.keys().next().value;if(Q!==void 0)s.delete(Q);else break}s.set(J,$)}function F6(J){return/^\s*[Mm]/.test(J)}function RJ(){if(B0)return B0;if(typeof document>"u")throw Error("PathParser requires a browser environment");return i=document.createElementNS("http://www.w3.org/2000/svg","svg"),i.style.cssText="position:absolute;width:0;height:0;overflow:hidden;visibility:hidden;",i.setAttribute("aria-hidden","true"),B0=document.createElementNS("http://www.w3.org/2000/svg","path"),i.appendChild(B0),document.body.appendChild(i),B0}function EJ(J){if(J instanceof Element)return J.getAttribute("d");if(typeof J==="string"){if(F6(J))return J;if(typeof document<"u"){let $=document.querySelector(J);if($)return $.getAttribute("d")}}return null}function bJ(J){let $=I6(J);if($!==void 0)return $;try{let Q=RJ();Q.setAttribute("d",J);let Z=Q.getTotalLength();return A6(J,Z),Z}catch{return 0}}function ZJ(J,$,Q=!1){try{let Z=RJ();Z.setAttribute("d",J);let j=Z.getTotalLength(),q=Math.max(0,Math.min(1,$)),G=j*q,z=Z.getPointAtLength(G),W=0;if(Q)W=O6(Z,G,j);return{x:z.x,y:z.y,angle:W}}catch{return{x:0,y:0,angle:0}}}function O6(J,$,Q){let Z=Math.min(0.1,Q*0.001),j=Math.max(0,$-Z),q=Math.min(Q,$+Z),G=J.getPointAtLength(j),z=J.getPointAtLength(q),W=z.x-G.x,N=z.y-G.y;return Math.atan2(N,W)*(180/Math.PI)}function xJ(J,$=[50,50]){if(!J)return{x:0,y:0};let Q=null;if(J instanceof Element)Q=J;else if(typeof J==="string"&&typeof document<"u")Q=document.querySelector(J);if(!Q||typeof Q.getBoundingClientRect!=="function")return{x:0,y:0};let Z=Q.getBoundingClientRect(),j=Z.width*$[0]/100,q=Z.height*$[1]/100;return{x:j,y:q}}function CJ(J,$,Q){if(!J)return{x:0,y:0};let Z=null;if(J instanceof Element)Z=J;else if(typeof J==="string"&&typeof document<"u")Z=document.querySelector(J);if(!Z)return{x:0,y:0};let j=ZJ($,0,!1);if(Q&&Q instanceof HTMLElement){let q=Q.style.transform,G=q&&q!=="none"&&q!=="";if(G)Q.style.transform="none";let z=Q.getBoundingClientRect(),W=Z.getBoundingClientRect();if(G)Q.style.transform=q;let N=W.left+W.width/2-(z.left+z.width/2),B=W.top+W.height/2-(z.top+z.height/2);return{x:N-j.x,y:B-j.y}}return{x:-j.x,y:-j.y}}function VJ(){if(i&&i.parentNode)i.parentNode.removeChild(i);i=null,B0=null,s.clear()}var L6=new Set(["perspective","x","y","z","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skewX","skewY"]),M6=new Set(["perspective","x","y","z","width","height","top","left","right","bottom","margin","marginTop","marginRight","marginBottom","marginLeft","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","borderRadius","fontSize","lineHeight"]),k6=new Set(["rotate","rotateX","rotateY","rotateZ","skewX","skewY"]),D6=new Set(["opacity","scale","scaleX","scaleY","scaleZ","z-index","zIndex"]),R6=new Set(["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor","textDecorationColor","caretColor","fill","stroke"]),E6=new Set(["red","green","blue","yellow","orange","purple","pink","cyan","magenta","white","black","gray","grey","transparent","crimson","gold","silver","navy","teal","maroon","olive","lime","aqua","fuchsia","coral","salmon","tomato","indigo"]);function h(J){return L6.has(J)}function q0(J){return R6.has(J)}function r(J){return J==="filter"}function jJ(J){return J==="drawSVG"}function qJ(J){return J==="path"}function t(J){return J.startsWith("--")}function wJ(J){if(typeof J!=="string")return!1;let $=J.trim().toLowerCase();if($.startsWith("#"))return!0;if(/^(rgb|rgba|hsl|hsla)\s*\(/.test($))return!0;let Q=U.color;if(Q)return Q.parseColor($)!==null;return E6.has($)}function V(J){if(typeof J==="number"){if(isNaN(J)||!isFinite(J))return console.warn(`[Motion] Property value is ${J}. This property will not animate correctly.`),{value:0,unit:""};return{value:J,unit:""}}if(typeof J==="string"){let $=J.match(/^([+\-*/])=(.+)/);if($){let Z=$[2].match(/([-+]?[\d.]+(?:e[-+]?\d+)?)([a-z%]*)/i);if(Z)return{value:parseFloat(Z[1]),unit:Z[2]||""}}let Q=J.match(/([-+]?[\d.]+(?:e[-+]?\d+)?)([a-z%]*)/i);if(Q)return{value:parseFloat(Q[1]),unit:Q[2]||""}}return{value:0,unit:""}}function g(J){if(D6.has(J))return"";if(k6.has(J))return"deg";if(M6.has(J))return"px";return""}function SJ(J){if(J==="opacity")return 1;if(J.startsWith("scale"))return 1;return 0}function p(J,$){if(!(J instanceof Element)){let Q=J;if($ in Q)return Q[$];return b6($)}if(h($))return e0(J,$);try{if(typeof window<"u"&&window.getComputedStyle){let Z=window.getComputedStyle(J).getPropertyValue(n($));if(Z)return V(Z).value}}catch(Q){}return SJ($)}function yJ(J,$){let Q=J,Z=n($);if(h($)){let j=Q.style.transform;v(J),Q.style.transform="";let q=e0(J,$);return Q.style.transform=j,v(J),{value:q,unit:g($)}}try{if(typeof window<"u"&&window.getComputedStyle){let j=Q.style.getPropertyValue(Z);Q.style.removeProperty(Z);let G=window.getComputedStyle(J).getPropertyValue(Z);if(j)Q.style.setProperty(Z,j);if(G){let z=V(G);return{value:z.value,unit:z.unit}}}}catch(j){}return{value:SJ($),unit:g($)}}function b6(J){if(J.startsWith("scale"))return 1;return 0}function n(J){return J.replace(/[A-Z]/g,($)=>`-${$.toLowerCase()}`)}function x6(J){if(typeof J==="string")return/^[+\-*/]=/.test(J);return!1}function C6(J){let $=J.match(/^([+\-*/])=/);return $?$[0]:null}function V6(J,$,Q){switch(Q){case"+=":return J+$;case"-=":return J-$;case"*=":return J*$;case"/=":return $!==0?J/$:J;default:return $}}function w6(J,$,Q,Z){let j=U.color;if(!j)return null;let q=String(Q),G=q===""?j.getCurrentColor(J,$):j.parseColor(q,J),z=Z!==void 0?j.parseColor(String(Z),J):j.getCurrentColor(J,$);return{type:"color",property:$,isTransform:!1,startColor:z||new Float32Array([0,0,0,1]),endColor:G||new Float32Array([0,0,0,1])}}function P6(J,$,Q,Z){let j=U.filter;if(!j)return null;let q=String(Q),G=q===""?j.getCurrentFilter(J):j.parseFilter(q),z=Z!==void 0?j.parseFilter(String(Z)):j.getCurrentFilter(J);z=z||[],G=G||[];let W=j.mergeFilterArrays(z,G);return{type:"filter",property:$,isTransform:!1,startFilters:W.start,endFilters:W.end}}function S6(J,$,Q,Z){if(wJ(Q)||Z!==void 0&&wJ(Z)){let W=U.color;if(W){let N=String(Q),B=W.parseColor(N,J),_=Z!==void 0?W.parseColor(String(Z),J):y6(J,$);return{type:"color",property:$,isTransform:!1,startColor:_||new Float32Array([0,0,0,1]),endColor:B||new Float32Array([0,0,0,1])}}}let q,G,z;if(Z!==void 0&&Q!==void 0){let W=V(Z),N=V(Q);q=W.value,G=N.value,z=N.unit||W.unit}else if(Z!==void 0){let W=V(Z);q=W.value,G=PJ(J,$),z=W.unit}else{let W=V(Q);q=PJ(J,$),G=W.value,z=W.unit}return{type:"scalar",property:$,isTransform:!1,startValue:q,endValue:G,unit:z}}function y6(J,$){let Q=U.color;if(!Q)return null;try{if(typeof window<"u"&&window.getComputedStyle){let j=window.getComputedStyle(J).getPropertyValue($).trim();if(j)return Q.parseColor(j,J)}}catch{}return null}function PJ(J,$){try{if(typeof window<"u"&&window.getComputedStyle){let Z=window.getComputedStyle(J).getPropertyValue($).trim();if(Z)return V(Z).value}}catch{}return 0}function v6(J,$,Q,Z){let j=U.drawSVG;if(!j)return null;let q=j.getPathLength(J),G=j.parseDrawSVG(Q,J)||{start:0,end:1},z=Z!==void 0?j.parseDrawSVG(Z,J)||{start:0,end:1}:j.getCurrentDrawSVG(J);return{type:"drawSVG",property:$,isTransform:!1,startDraw:z,endDraw:G,length:q}}function h6(J,$,Q,Z){let j=Q,q=Z,G=j?.target?j:q;if(!G?.target)return null;let z=EJ(G.target);if(!z)return null;let W=bJ(z);if(W===0)return null;let N,B;if(j?.target&&q?.target)N=q.start??0,B=j.end??1;else if(j?.target)N=j.start??0,B=j.end??1;else N=q.start??0,B=q.end??1;let _=j?.rotate??q?.rotate??!1,X=j?.alignAt??q?.alignAt??[50,50],Y=xJ(J,X),H=j?.align??q?.align,I=CJ(H,z,J);return{type:"path",property:$,isTransform:!1,pathData:z,pathLength:W,startProgress:N,endProgress:B,rotate:_,alignOffset:Y,pathOffset:I}}function vJ(J,$,Q,Z){let j=J instanceof Element;if(j&&t($))return S6(J,$,Q,Z);if(j&&q0($)){let B=w6(J,$,Q,Z);if(B)return B}if(j&&r($)){let B=P6(J,$,Q,Z);if(B)return B}if(j&&jJ($)){let B=v6(J,$,Q,Z);if(B)return B}if(j&&qJ($)){let B=h6(J,$,Q,Z);if(B)return B}let q=h($),G=Z===void 0&&x6(Q),z,W,N;if(Z!==void 0){let B=V(Z);if(Q!==void 0){let _=V(Q);z=B.value,W=_.value,N=_.unit||B.unit||g($)}else z=B.value,W=p(J,$),N=B.unit||g($)}else if(G){let B=C6(Q),_=p(J,$),X=V(Q);z=_,W=V6(_,X.value,B),N=X.unit||g($)}else{let B=p(J,$),_=V(Q);z=B,W=_.value,N=_.unit||g($)}return{type:"scalar",property:$,isTransform:q,startValue:z,endValue:W,unit:N}}function hJ(){let J=new WeakMap;return{register($,Q){let Z=J.get($);if(!Z)Z=new Set,J.set($,Z);Z.add(Q)},registerMany($,Q){for(let Z of Q)this.register($,Z)},get($){return J.get($)},clearRegistry($){J.delete($)}}}var GJ=hJ(),w0=new WeakMap,zJ=hJ();function TJ(J){if(h(J))return["transform"];if(r(J))return["filter"];if(jJ(J))return["strokeDasharray","strokeDashoffset"];return[J]}function T6(J,$){if(h($)&&!w0.has(J)){if(J instanceof HTMLElement||J instanceof SVGElement){let Z=J.style.transform;w0.set(J,Z||null)}}let Q=TJ($);for(let Z of Q)GJ.register(J,Z)}function f6(J,$){for(let Q of $)T6(J,Q)}function u6(J){GJ.clearRegistry(J),w0.delete(J)}function d6(J,$){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let Q=new Set;for(let Z of $)for(let j of TJ(Z))Q.add(j);for(let Z of Q)if(t(Z))J.style.removeProperty(Z);else J.style[Z]=""}function p6(J){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let $=GJ.get(J);if(!$||$.size===0)return;for(let Q of $){if(Q==="transform"){let Z=w0.get(J);if(Z!==void 0){if(Z)J.style.transform=Z;else J.style.removeProperty("transform");continue}}if(t(Q))J.style.removeProperty(Q);else J.style[Q]=""}}function c6(J){p6(J),u6(J)}function I0(J,$){zJ.registerMany(J,$)}function WJ(J){zJ.clearRegistry(J)}function m6(J){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let $=zJ.get(J);if(!$||$.size===0)return;for(let Q of $)J.style[Q]=""}function g6(J){m6(J),WJ(J)}U.styleReset={registerAnimatedProps:f6,clearAnimationStylesForProps:d6,clearAnimationStylesAndUnregister:c6,clearPinStylesAndUnregister:g6};class w{static _registry=new Map;static _users=new Map;static getOrCreate(J,$){let Q=w._registry.get($);if(!Q)Q=new w(J),w._registry.set($,Q);let Z=w._users.get($);if(!Z)Z=new Set,w._users.set($,Z);return Z.add(J),Q}static release(J,$){let Q=w._users.get($);if(!Q)return;if(Q.delete(J),Q.size===0){let Z=w._registry.get($);w._registry.delete($),w._users.delete($),Z?.cleanup()}}_id;_element=null;_originalStyles=null;_spacer=null;_currentState="before";_pinStart=0;_pinEnd=0;_pinDistance=0;_useFixedPin=!1;_pinSpacing;_elementHeight=0;_fixedTop=0;_fixedLeft=0;_width=0;_fixedBreakingAncestors=[];_isBodyPin=!1;_originalHtmlHeight="";_originalHtmlOverflow="";constructor(J){this._id=J}setup(J,$,Q,Z,j,q){if(typeof document>"u")return;this._isBodyPin=J===document.body,this._element=J,this._pinStart=$,this._pinEnd=Q;let G=this._pinDistance;this._pinDistance=Q-$,this._useFixedPin=j,this._pinSpacing=q;let z=this._isBodyPin?this._originalStyles!==null:this._spacer!==null;if(z&&this._currentState==="pinned"&&j)this._updateFixed("before");if(z&&this._spacer)this._spacer.style.width="";let W=z&&this._isBodyPin?document.documentElement.style.height:null;if(W!==null)document.documentElement.style.height=this._originalHtmlHeight;let N=J.getBoundingClientRect();if(W!==null)document.documentElement.style.height=W;let B=z&&this._spacer?window.getComputedStyle(this._spacer):window.getComputedStyle(J);if(this._elementHeight=N.height,!z)this._originalStyles={position:J.style.position,top:J.style.top,left:J.style.left,width:J.style.width,marginTop:J.style.marginTop,marginBottom:J.style.marginBottom,marginLeft:J.style.marginLeft,marginRight:J.style.marginRight,zIndex:J.style.zIndex};if(j)if(this._fixedTop=Z,this._isBodyPin){if(this._fixedLeft=N.left,this._width=N.width,!z)this._originalHtmlHeight=document.documentElement.style.height,this._originalHtmlOverflow=document.documentElement.style.overflow,this._detectFixedBreakingAncestors(J);document.documentElement.style.height=`${this._elementHeight+this._pinDistance}px`}else{let _=this._resolvePinSpacing(),X=window.getComputedStyle(J),Y=X.display,H=X.flexDirection,I=z&&this._spacer?.parentElement?this._spacer.parentElement:J.parentElement,K=I?/^(inline-)?flex$/.test(getComputedStyle(I).display):!1,F=/^(inline-)?flex$/.test(Y),M=`
|
|
2
|
+
display: ${Y};
|
|
3
|
+
${F?`flex-direction: ${H};`:""}
|
|
3
4
|
box-sizing: content-box;
|
|
4
|
-
width: ${
|
|
5
|
-
height: ${
|
|
6
|
-
margin-top: ${
|
|
7
|
-
margin-left: ${
|
|
8
|
-
margin-right: ${
|
|
5
|
+
width: ${N.width}px;
|
|
6
|
+
height: ${N.height}px;
|
|
7
|
+
margin-top: ${B.marginTop};
|
|
8
|
+
margin-left: ${B.marginLeft};
|
|
9
|
+
margin-right: ${B.marginRight};
|
|
9
10
|
overflow: visible;
|
|
10
|
-
|
|
11
|
+
${K?"flex-shrink: 0;":""}
|
|
12
|
+
`;if(_==="padding")M+=`padding-bottom: ${this._pinDistance}px;`,M+=`margin-bottom: ${B.marginBottom};`;else if(_==="margin"){let O=parseFloat(B.marginBottom)||0,P=z?O-G:O;M+=`margin-bottom: ${P+this._pinDistance}px;`}else M+=`margin-bottom: ${B.marginBottom};`;if(!this._spacer)this._detectFixedBreakingAncestors(J),this._spacer=document.createElement("div"),J.parentNode?.insertBefore(this._spacer,J),this._spacer.appendChild(J),J.style.marginTop="0",J.style.marginBottom="0",J.style.marginLeft="0",J.style.marginRight="0";this._spacer.style.cssText=M,this._spacer.setAttribute("data-scrolltrigger-spacer",String(this._id));let k=this._spacer.getBoundingClientRect();this._fixedLeft=k.left,this._width=k.width}this._currentState="before"}update(J){if(!this._element)return;let $=J<this._pinStart?"before":J<this._pinEnd?"pinned":"after";if(this._useFixedPin){if($!==this._currentState)this._updateFixed($),this._currentState=$}else if($!==this._currentState||$==="pinned")this._updateTransform($,J),this._currentState=$}cleanup(){if(this._element&&w._registry.get(this._element)===this)w._registry.delete(this._element),w._users.delete(this._element);if(this._element&&this._originalStyles){let J=this._element;W0(J),J.style.position=this._originalStyles.position,J.style.top=this._originalStyles.top,J.style.left=this._originalStyles.left,J.style.width=this._originalStyles.width,J.style.marginTop=this._originalStyles.marginTop,J.style.marginBottom=this._originalStyles.marginBottom,J.style.marginLeft=this._originalStyles.marginLeft,J.style.marginRight=this._originalStyles.marginRight,J.style.zIndex=this._originalStyles.zIndex,J.style.transform="",WJ(J)}if(this._isBodyPin){if(typeof document<"u")document.documentElement.style.height=this._originalHtmlHeight,document.documentElement.style.overflow=this._originalHtmlOverflow}else if(this._spacer?.parentNode&&this._element)this._spacer.parentNode.insertBefore(this._element,this._spacer),this._spacer.parentNode.removeChild(this._spacer);this._restoreFixedBreakingAncestors(),this._fixedBreakingAncestors=[],this._element=null,this._originalStyles=null,this._spacer=null,this._currentState="before",this._pinSpacing=void 0,this._isBodyPin=!1,this._originalHtmlHeight="",this._originalHtmlOverflow=""}getElement(){return this._element}getPinDistance(){return this._pinDistance}getState(){return this._currentState}getLayoutRect(){if(this._spacer?.parentNode){let J=this._spacer.getBoundingClientRect();return{top:J.top,left:J.left,width:J.width,height:this._elementHeight,bottom:J.top+this._elementHeight,right:J.left+J.width}}return null}isBodyPin(){return this._isBodyPin}suspendHtmlHeight(){if(!this._isBodyPin)return null;let J=document.documentElement.style.height;return document.documentElement.style.height=this._originalHtmlHeight,()=>{document.documentElement.style.height=J}}isFixedPin(){return this._useFixedPin}_detectFixedBreakingAncestors(J){this._fixedBreakingAncestors=[];let $=J.parentElement;while($&&$!==document.documentElement){let Q=window.getComputedStyle($),Z=[];if(Q.filter&&Q.filter!=="none")Z.push({property:"filter",originalValue:""});if(Q.transform&&Q.transform!=="none")Z.push({property:"transform",originalValue:""});if(Q.perspective&&Q.perspective!=="none")Z.push({property:"perspective",originalValue:""});if(Q.willChange&&Q.willChange!=="auto"){if(Q.willChange.split(",").map((q)=>q.trim()).some((q)=>q==="transform"||q==="filter"||q==="perspective"))Z.push({property:"willChange",originalValue:""})}if(Q.contain&&Q.contain!=="none"){if(["paint","layout","strict","content"].some((q)=>Q.contain.includes(q)))Z.push({property:"contain",originalValue:""})}if(Q.backdropFilter&&Q.backdropFilter!=="none")Z.push({property:"backdropFilter",originalValue:""});if(Q.overflow==="clip"||Q.overflowX==="clip"||Q.overflowY==="clip"){if(Q.overflowY==="clip")Z.push({property:"overflowY",originalValue:""});if(Q.overflowX==="clip")Z.push({property:"overflowX",originalValue:""})}if(Z.length>0)this._fixedBreakingAncestors.push({element:$,overrides:Z});$=$.parentElement}}_overrideFixedBreakingAncestors(){for(let{element:J,overrides:$}of this._fixedBreakingAncestors)for(let Q of $)switch(Q.originalValue=J.style[Q.property]||"",Q.property){case"filter":case"backdropFilter":case"transform":case"perspective":J.style[Q.property]="none";break;case"willChange":J.style.willChange="auto";break;case"contain":J.style.contain="none";break;case"overflowY":J.style.overflowY="visible";break;case"overflowX":J.style.overflowX="hidden";break}}_restoreFixedBreakingAncestors(){for(let{element:J,overrides:$}of this._fixedBreakingAncestors)for(let{property:Q,originalValue:Z}of $)J.style[Q]=Z}_resolvePinSpacing(){if(this._pinSpacing===!1)return!1;if(this._pinSpacing==="margin")return"margin";if(this._pinSpacing===void 0||this._pinSpacing===!0){if(this._isBodyPin)return!1}return"padding"}_updateFixed(J){let $=this._element;if(J==="before"){if($.style.position=this._originalStyles?.position||"",$.style.top=this._originalStyles?.top||"",$.style.left=this._originalStyles?.left||"",$.style.width=this._originalStyles?.width||"",this._isBodyPin)$.style.marginTop=this._originalStyles?.marginTop||"";else $.style.marginTop="0",$.style.marginLeft="0";$.style.zIndex=this._originalStyles?.zIndex||"",W0($),$.style.transform=R($),this._restoreFixedBreakingAncestors()}else if(J==="pinned"){if(this._overrideFixedBreakingAncestors(),$.style.position="fixed",$.style.top=`${this._fixedTop}px`,$.style.left=`${this._fixedLeft}px`,$.style.width=`${this._width}px`,this._isBodyPin)$.style.marginTop=this._originalStyles?.marginTop||"";else $.style.marginTop="0",$.style.marginLeft="0";if($.style.zIndex="100",W0($),$.style.transform=R($),this._isBodyPin)I0($,["position","top","left","width","zIndex","transform","marginTop"]);else I0($,["position","top","left","width","marginTop","marginLeft","zIndex","transform"])}else{if($.style.position=this._originalStyles?.position||"",$.style.top=this._originalStyles?.top||"",$.style.left=this._originalStyles?.left||"",$.style.width=this._originalStyles?.width||"",this._isBodyPin)W0($),$.style.transform=R($),$.style.marginTop=`${this._pinDistance}px`;else $.style.marginTop="0",$.style.marginLeft="0",E0($,0,this._pinDistance,0),$.style.transform=R($);$.style.zIndex=this._originalStyles?.zIndex||"",this._restoreFixedBreakingAncestors()}}_updateTransform(J,$){let Q=this._element;if(J==="before")Q.style.zIndex=this._originalStyles?.zIndex||"",W0(Q),Q.style.transform=R(Q);else if(J==="pinned"){let Z=Math.round($-this._pinStart);Q.style.zIndex="100",E0(Q,0,Z,0),Q.style.transform=R(Q),I0(Q,["transform","zIndex"])}else Q.style.zIndex=this._originalStyles?.zIndex||"",E0(Q,0,this._pinDistance,0),Q.style.transform=R(Q),I0(Q,["transform","zIndex"])}}function T(J,$,Q,Z){if(!J)return 0;let j=J.trim().toLowerCase(),q=j.match(/^(top|center|bottom)([+-])(-?\d+(?:\.\d+)?)(px|%|vh|vw)?$/);if(q){let z=q[1],W=q[2]==="-"?-1:1,N=parseFloat(q[3]),B=q[4]||"px",_=0;switch(z){case"top":_=0;break;case"center":_=$/2;break;case"bottom":_=$;break}let X=fJ(N,B,$,Q,Z);return _+W*X}switch(j){case"top":return 0;case"center":return $/2;case"bottom":return $}let G=j.match(/^(-?\d+(?:\.\d+)?)(px|%|vh|vw)?$/);if(G){let z=parseFloat(G[1]),W=G[2]||"px";return fJ(z,W,$,Q,Z)}return 0}function fJ(J,$,Q,Z,j){switch($){case"px":return J;case"%":return J/100*Q;case"vh":return J/100*Z;case"vw":return J/100*(j??(typeof window<"u"?window.innerWidth:0));default:return J}}class NJ{_id;_markers;_markerContainer;_triggerElement;_scrollerStartOffset=0;_scrollerEndOffset=0;_scroller=window;_startConfig="top top";_endConfig="bottom top";_cachedElStartDocTop=0;_cachedElEndDocTop=0;_cachedElPositionValid=!1;constructor(J){this._id=J}setup(J){if(typeof document>"u")return;this._scroller=J.scroller,this._triggerElement=J.triggerElement||void 0,this._startConfig=J.startConfig,this._endConfig=J.endConfig;let $=J.markerConfig,Q=(typeof $==="object"?$.startColor:null)||"lime",Z=(typeof $==="object"?$.endColor:null)||"red",j=(typeof $==="object"?$.fontSize:null)||"10px",q=this._scroller!==window,G=J.viewportHeight,z=this._startConfig.split(" "),W=T(z[1]||"top",G,G),N=this._endConfig.startsWith("+=")?W:T(this._endConfig.split(" ")[1]||"top",G,G);this._markerContainer=document.createElement("div"),this._markerContainer.setAttribute("data-scrolltrigger-markers",String(this._id)),this._markerContainer.style.cssText="position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; z-index: 9999;";let B=(I,K,F)=>{let M=document.createElement("div");M.setAttribute("data-marker",I),M.style.cssText=`
|
|
11
13
|
position: absolute;
|
|
12
|
-
${
|
|
14
|
+
${F}: 0;
|
|
13
15
|
height: 1px;
|
|
14
16
|
width: 50px;
|
|
15
17
|
background: ${K};
|
|
16
18
|
pointer-events: none;
|
|
17
|
-
`;let
|
|
19
|
+
`;let k=document.createElement("span");return k.textContent=I,k.style.cssText=`
|
|
18
20
|
position: absolute;
|
|
19
|
-
${
|
|
21
|
+
${F}: 0;
|
|
20
22
|
top: 2px;
|
|
21
23
|
background: ${K};
|
|
22
24
|
color: ${K==="lime"?"#000":"#fff"};
|
|
23
25
|
padding: 1px 3px;
|
|
24
|
-
font-size: ${
|
|
26
|
+
font-size: ${j};
|
|
25
27
|
font-family: monospace;
|
|
26
28
|
white-space: nowrap;
|
|
27
29
|
border-radius: 2px;
|
|
28
30
|
line-height: 1.2;
|
|
29
|
-
`,k.appendChild(M),k},_=N("scroller-start",Q,"right"),X=N("scroller-end",q,"right"),H=N("start",Q,"left"),Y=N("end",q,"left");if(!this._triggerElement)H.style.display="none",Y.style.display="none";if(this._markerContainer.appendChild(_),this._markerContainer.appendChild(X),this._markerContainer.appendChild(H),this._markerContainer.appendChild(Y),this._markers={scrollerStart:_,scrollerEnd:X,elementStart:H,elementEnd:Y},j){let F=this._scroller;if(window.getComputedStyle(F).position==="static")F.style.position="relative";F.appendChild(this._markerContainer)}else document.body.appendChild(this._markerContainer),this._markerContainer.style.position="fixed";this._scrollerStartOffset=W,this._scrollerEndOffset=B,this._cacheElementPositions(G)}_cacheElementPositions(J){if(!this._triggerElement){this._cachedElPositionValid=!1;return}let $=u(this._triggerElement),Q=v(this._startConfig.split(" ")[0]||"top",$.height,J),q=this._endConfig.startsWith("+=")?Q:v(this._endConfig.split(" ")[0]||"bottom",$.height,J);if(this._scroller!==window){let j=this._scroller.getBoundingClientRect(),G=this._scroller.scrollTop,z=$.top-j.top+G;this._cachedElStartDocTop=z+Q,this._cachedElEndDocTop=z+q}else{let j=window.scrollY||window.pageYOffset||0,G=$.top+j;this._cachedElStartDocTop=G+Q,this._cachedElEndDocTop=G+q}this._cachedElPositionValid=!0}update(J,$,Q){if(!this._markers||!this._markerContainer)return;let q=this._triggerElement;if(this._triggerElement=$||void 0,this._triggerElement!==q)this._cacheElementPositions(Q);let Z=this._scroller!==window;if(Z)this._markers.scrollerStart.style.top=`${J+this._scrollerStartOffset}px`,this._markers.scrollerEnd.style.top=`${J+this._scrollerEndOffset}px`;else this._markers.scrollerStart.style.top=`${this._scrollerStartOffset}px`,this._markers.scrollerEnd.style.top=`${this._scrollerEndOffset}px`;if(this._triggerElement&&this._cachedElPositionValid)if(this._markers.elementStart.style.display="",this._markers.elementEnd.style.display="",Z)this._markers.elementStart.style.top=`${this._cachedElStartDocTop}px`,this._markers.elementEnd.style.top=`${this._cachedElEndDocTop}px`;else this._markers.elementStart.style.top=`${this._cachedElStartDocTop-J}px`,this._markers.elementEnd.style.top=`${this._cachedElEndDocTop-J}px`;else this._markers.elementStart.style.display="none",this._markers.elementEnd.style.display="none"}recachePositions(J){this._cacheElementPositions(J)}cleanup(){if(this._markerContainer&&this._markerContainer.parentNode)this._markerContainer.parentNode.removeChild(this._markerContainer);this._markerContainer=void 0,this._markers=void 0,this._triggerElement=void 0}}class i extends f{static _nextId=0;_id;static _SCRUB_TICKER_PRIORITY=1;static _activeInstances=new Set;static _loadListenerAdded=!1;_scrollListener;_scrubTickListener=null;_currentProgress=0;_targetProgress=0;_scrubLag=0;_scroller;_triggerStart=0;_triggerEnd=0;_pinManager=null;_markerManager=null;_triggerState="before";_toggleActions=["play","none","none","none"];_initializing=!1;constructor(J,$){super(J,$);this._id=i._nextId++,this._scrubLag=typeof $.scrub==="number"?$.scrub:0}static _ensureLoadListener(){if(i._loadListenerAdded||typeof window>"u")return;if(i._loadListenerAdded=!0,document.readyState==="complete")return;window.addEventListener("load",()=>{setTimeout(()=>{for(let J of i._activeInstances)J.refresh()},100)},{once:!0})}_resolveScroller(){if(this._config.scroller)if(typeof this._config.scroller==="string"){if(typeof document>"u"){this._scroller=window;return}try{let J=document.querySelector(this._config.scroller);this._scroller=J??window}catch(J){console.warn(`[Motion] Invalid scroller selector "${this._config.scroller}":`,J),this._scroller=window}}else this._scroller=this._config.scroller;else this._scroller=window}_resolvePinElement(){if(!this._config.pin||typeof document>"u")return null;let J=null;if(typeof this._config.pin==="string")J=document.querySelector(this._config.pin);else if(this._config.pin===!0)J=this._getFirstAnimatedElement();return J}_defaultStart(){return this._config.start||(this._config.pin?"top top":"top bottom")}_defaultEnd(){return this._config.end||"bottom top"}_getFirstAnimatedElement(){let J=this._timeline.getFirstChildBuilder();if(J){let Q=J.hasSplit()?J.getOriginalTargets():J.getTargets();for(let q of Q)if(q instanceof HTMLElement)return q}let $=this._timeline.getFirstChildAnimation();if($){let Q=$.getTargets();if(Q.length>0&&Q[0]instanceof HTMLElement)return Q[0]}return null}_resolveTriggerElement(){if(this._config.target instanceof HTMLElement)return this._config.target;if(typeof this._config.target==="string"&&typeof document<"u"){let J=document.querySelector(this._config.target);if(J instanceof HTMLElement)return J}return this._getFirstAnimatedElement()}_calculateTriggerPositions(J){let $=J||this._resolveTriggerElement(),Q=this._getViewportHeight(),q=this._getScrollTop();if(!$){this._triggerStart=0,this._triggerEnd=this._getScrollHeight();return}let Z=this._pinManager?.getLayoutRect()??u($),j;if(this._scroller instanceof Element){let H=this._scroller.getBoundingClientRect();j=Z.top-H.top+q}else j=Z.top+q;let z=this._defaultStart().split(" "),W=z[0]||"top",B=z[1]||"top",N=v(W,Z.height,Q),_=v(B,Q,Q);this._triggerStart=j+N-_;let X=this._defaultEnd();if(X.startsWith("+=")){let H=v(X.slice(2),Q,Q);this._triggerEnd=this._triggerStart+H}else{let H=X.split(" "),Y=H[0]||"bottom",F=H[1]||"top",K=v(Y,Z.height,Q),L=v(F,Q,Q);this._triggerEnd=j+K-L}if(this._triggerEnd<=this._triggerStart)this._triggerEnd=this._triggerStart+Math.max(Q,100)}_onEnable(){this._resolveScroller();let J=this._resolvePinElement();this._calculateTriggerPositions(J),i._activeInstances.add(this),i._ensureLoadListener();let Q=(this._config.toggleActions||"play none none none").trim().split(/\s+/);if(this._toggleActions=[Q[0],Q[1],Q[2],Q[3]],J){let Z=this._defaultStart().split(" "),j=this._getViewportHeight(),G=v(Z[0]||"top",J.getBoundingClientRect().height,j),W=v(Z[1]||"top",j,j)-G;this._pinManager=C.getOrCreate(this._id,J),this._pinManager.setup(J,this._triggerStart,this._triggerEnd,W,this._scroller===window,this._config.pinSpacing)}if(this._config.markers&&typeof document<"u"){let q=this._pinManager?.getElement()||this._resolveTriggerElement();this._markerManager=new BJ(this._id),this._markerManager.setup({scroller:this._scroller,triggerElement:q,startConfig:this._defaultStart(),endConfig:this._defaultEnd(),markerConfig:this._config.markers,viewportHeight:this._getViewportHeight()})}if(this._scrollListener=()=>this._onScroll(),this._scroller){if(this._scroller.addEventListener("scroll",this._scrollListener,{passive:!0}),this._initializing=!0,this._onScroll(),this._initializing=!1,this._config.scrub===!1||this._config.scrub===void 0){if(this._triggerState==="active")w(this._toggleActions[0],this._timeline);else if(this._triggerState==="after")this._timeline.progress(1),this._timeline.pause()}}}_onDisable(){if(this._scrollListener&&this._scroller)this._scroller.removeEventListener("scroll",this._scrollListener);if(this._markerManager?.cleanup(),this._markerManager=null,this._pinManager){let J=this._pinManager.getElement();if(J)C.release(this._id,J);else this._pinManager.cleanup();this._pinManager=null}this._stopSmoothScrollLoop(),i._activeInstances.delete(this)}refresh(){if(!this._enabled)return;let J=this._pinManager?.getElement()||null,$=this._pinManager?.suspendHtmlHeight?.()??null;if(this._calculateTriggerPositions(J),$?.(),this._pinManager&&J){let q=this._defaultStart().split(" "),Z=this._getViewportHeight(),j=this._pinManager.getLayoutRect()?.height??J.getBoundingClientRect().height,G=v(q[0]||"top",j,Z),W=v(q[1]||"top",Z,Z)-G;this._pinManager.setup(J,this._triggerStart,this._triggerEnd,W,this._scroller===window,this._config.pinSpacing)}if(this._markerManager)this._markerManager.recachePositions(this._getViewportHeight());this._onScroll()}_getViewportHeight(){if(this._scroller===window)return typeof window<"u"?window.innerHeight:0;else if(this._scroller instanceof Element)return this._scroller.clientHeight;return 0}_getScrollTop(){if(this._scroller===window)return typeof window<"u"?window.scrollY||window.pageYOffset:0;else if(this._scroller instanceof Element)return this._scroller.scrollTop;return 0}_getScrollHeight(){if(this._scroller===window){if(typeof document<"u"&&document.documentElement)return document.documentElement.scrollHeight-window.innerHeight;return 0}else if(this._scroller instanceof Element)return this._scroller.scrollHeight-this._scroller.clientHeight;return 0}_onScroll(){if(!this._enabled)return;let J=this._getScrollTop(),$=this._triggerEnd-this._triggerStart,Q=$>0?(J-this._triggerStart)/$:0;if(Q=Math.max(0,Math.min(1,Q)),Q=this._applySnap(Q),this._targetProgress=Q,this._pinManager?.update(J),this._markerManager){let q=this._pinManager?.getElement()||this._resolveTriggerElement();this._markerManager.update(J,q,this._getViewportHeight())}if(this._config.scrub!==!1&&this._config.scrub!==void 0)if(this._scrubLag===0)this._currentProgress=this._targetProgress,qJ(()=>this._timeline.progress(this._currentProgress));else this._startSmoothScrollLoop();else{let q;if(Q<=0)q="before";else if(Q>=1)q="after";else q="active";if(q!==this._triggerState){let Z=this._triggerState;if(this._triggerState=q,this._initializing)return;qJ(()=>{if(q==="active"&&Z==="before")w(this._toggleActions[0],this._timeline);else if(q==="after"&&Z==="active")w(this._toggleActions[1],this._timeline);else if(q==="active"&&Z==="after")w(this._toggleActions[2],this._timeline);else if(q==="before"&&Z==="active")w(this._toggleActions[3],this._timeline);else if(q==="after"&&Z==="before")w(this._toggleActions[0],this._timeline),this._timeline.progress(1),w(this._toggleActions[1],this._timeline);else if(q==="before"&&Z==="after")w(this._toggleActions[2],this._timeline),this._timeline.progress(0),w(this._toggleActions[3],this._timeline)})}}}_applySnap(J){let $=this._config.snap;if($==null)return J;if(typeof $==="function")return $(J);if(Array.isArray($)){let Q=$[0]??J,q=Math.abs(J-Q);for(let Z=1;Z<$.length;Z++){let j=Math.abs(J-$[Z]);if(j<q)q=j,Q=$[Z]}return Q}if(typeof $==="number"&&$>0)return Math.round(J/$)*$;return J}_startSmoothScrollLoop(){if(this._scrubTickListener)return;this._scrubTickListener=(J,$)=>{if(!this._enabled){this._stopSmoothScrollLoop();return}let Q=this._targetProgress-this._currentProgress,q=1-Math.exp(-J*3/this._scrubLag);if(this._currentProgress+=Q*q,Math.abs(this._targetProgress-this._currentProgress)<0.0001){this._currentProgress=this._targetProgress,this._timeline.progress(this._currentProgress),this._stopSmoothScrollLoop();return}this._timeline.progress(this._currentProgress)},V.getInstance().add(this._scrubTickListener,i._SCRUB_TICKER_PRIORITY)}_stopSmoothScrollLoop(){if(this._scrubTickListener)V.getInstance().remove(this._scrubTickListener),this._scrubTickListener=null}}I.registerTrigger("scroll",i);class uJ{_registrations=[];_domContentLoaded=!1;_windowLoaded=!1;_initialized=!1;constructor(){this._initialize()}_initialize(){if(this._initialized)return;if(this._initialized=!0,typeof document<"u"){if(document.addEventListener("DOMContentLoaded",()=>{this._domContentLoaded=!0,this._triggerDuring()}),typeof window<"u")window.addEventListener("load",()=>{this._windowLoaded=!0,this._triggerAfter()});if(document.readyState==="interactive"||document.readyState==="complete")this._domContentLoaded=!0;if(document.readyState==="complete")this._windowLoaded=!0}}register(J,$){let Q=$.timing||"during",q=$.paused===!0;if(this._registrations.push({timeline:J,timing:Q,paused:q}),q)return;if(Q==="before")J.play();else if(Q==="during"&&this._domContentLoaded)J.play();else if(Q==="after"&&this._windowLoaded)J.play()}unregister(J){this._registrations=this._registrations.filter(($)=>$.timeline!==J)}clear(){this._registrations=[]}_triggerDuring(){this._registrations.filter((J)=>J.timing==="during"&&!J.paused).forEach((J)=>J.timeline.play())}_triggerAfter(){this._registrations.filter((J)=>J.timing==="after"&&!J.paused).forEach((J)=>J.timeline.play())}_reset(){this._registrations=[],this._domContentLoaded=!1,this._windowLoaded=!1,this._initialized=!1,this._initialize()}}I.registerPageLoadTrigger(uJ);class dJ extends f{_targets=[];_listeners=new Map;_frozenRects=new Map;_state={x:0.5,y:0.5,distance:0.5,isInside:!1};_targetState={targetX:0.5,targetY:0.5,targetDistance:0.5};_tickerCallback;_defaultStartProgress=0.5;_defaultLeaveProgress=0.5;constructor(J,$){super(J,$);this._config={type:"distance",startProgress:this._defaultStartProgress,leaveProgress:this._defaultLeaveProgress,...$};let Q=this._config.startProgress??this._defaultStartProgress;this._state.x=Q,this._state.y=Q,this._state.distance=Q,this._targetState.targetX=Q,this._targetState.targetY=Q,this._targetState.targetDistance=Q}_onEnable(){if(this._targets=this._resolveElements(this._config.target),this._targets.length===0)this._addViewportListeners();else this._addTargetListeners();if(this._config.smooth!==void 0&&this._config.smooth>0)this._startSmoothingTicker();this._updateTimelineProgress()}_onDisable(){if(this._tickerCallback)V.getInstance().remove(this._tickerCallback),this._tickerCallback=void 0;this._frozenRects.clear(),this._cleanupListenerMap(this._listeners)}_addViewportListeners(){if(typeof window>"u")return;let J=new Map,$=(Q)=>{let q=Q;this._handleViewportMouseMove(q.clientX,q.clientY)};window.addEventListener("mousemove",$),J.set("mousemove",$),this._state.isInside=!0,this._listeners.set(window,J)}refresh(){for(let J of this._targets)this._frozenRects.set(J,u(J))}_addTargetListeners(){this._targets.forEach((J)=>{this._frozenRects.set(J,u(J));let $=new Map,Q=(j)=>{let G=j;this._handleTargetMouseMove(J,G.clientX,G.clientY)};J.addEventListener("mousemove",Q),$.set("mousemove",Q);let q=()=>{this._state.isInside=!0};J.addEventListener("mouseenter",q),$.set("mouseenter",q);let Z=()=>{this._state.isInside=!1,this._handleMouseLeave()};J.addEventListener("mouseleave",Z),$.set("mouseleave",Z),this._listeners.set(J,$)})}_handleViewportMouseMove(J,$){if(typeof window>"u")return;let{innerWidth:Q,innerHeight:q}=window,Z=Q/2,j=q/2;if(this._config.type==="axis")this._targetState.targetX=J/Q,this._targetState.targetY=$/q;else{let G=J-Z,z=$-j,W=Math.sqrt(G*G+z*z),B=Math.sqrt(Z*Z+j*j);this._targetState.targetDistance=1-Math.min(W/B,1)}this._applyProgress()}_handleTargetMouseMove(J,$,Q){let q=this._frozenRects.get(J)??J.getBoundingClientRect(),Z=q.left+q.width/2,j=q.top+q.height/2;if(this._config.type==="axis"){let G=$-q.left,z=Q-q.top;this._targetState.targetX=Math.max(0,Math.min(1,G/q.width)),this._targetState.targetY=Math.max(0,Math.min(1,z/q.height))}else{let G=$-Z,z=Q-j,W=Math.sqrt(G*G+z*z),B=Math.sqrt(Math.pow(q.width/2,2)+Math.pow(q.height/2,2));this._targetState.targetDistance=1-Math.min(W/B,1)}this._applyProgress()}_handleMouseLeave(){let J=this._config.leaveProgress??this._defaultLeaveProgress;if(this._targetState.targetX=J,this._targetState.targetY=J,this._targetState.targetDistance=J,!this._config.smooth)this._state.x=J,this._state.y=J,this._state.distance=J,this._updateTimelineProgress()}_applyProgress(){if(this._config.smooth)return;this._state.x=this._targetState.targetX,this._state.y=this._targetState.targetY,this._state.distance=this._targetState.targetDistance,this._updateTimelineProgress()}_startSmoothingTicker(){let J=Math.max(0,Math.min(1,this._config.smooth??0.1));this._tickerCallback=($)=>{let Q=this._lerp(this._state.x,this._targetState.targetX,J,$),q=this._lerp(this._state.y,this._targetState.targetY,J,$),Z=this._lerp(this._state.distance,this._targetState.targetDistance,J,$),j=0.0001,G=Math.abs(Q-this._state.x)<0.0001&&Math.abs(Q-this._targetState.targetX)<0.0001,z=Math.abs(q-this._state.y)<0.0001&&Math.abs(q-this._targetState.targetY)<0.0001,W=Math.abs(Z-this._state.distance)<0.0001&&Math.abs(Z-this._targetState.targetDistance)<0.0001;if(this._state.x=Q,this._state.y=q,this._state.distance=Z,!G||!z||!W)this._updateTimelineProgress()},V.getInstance().add(this._tickerCallback)}_lerp(J,$,Q,q){let Z=$-J;if(Math.abs(Z)<0.0001)return $;let j=0.5*Math.pow(1-Q,2)+0.005,G=1-Math.pow(1-j,q*60);return J+Z*G}_updateTimelineProgress(){if(this._config.type==="axis")this._timeline.setAxisProgress("x",this._state.x),this._timeline.setAxisProgress("y",this._state.y);else this._timeline.progress(this._state.distance)}}I.registerTrigger("mouseMove",dJ);class F0 extends f{_target=window;_tolerance;_dragMinimum;_dragMinimumSquared;_wheelSpeed;_scrollSpeed;_stopDelay;_preventDefault;_lockAxis;_animationStep;_smooth;_startX=0;_startY=0;_deltaX=0;_deltaY=0;_lockedAxis=null;_isPressed=!1;_isDragging=!1;_lastDirectionX=null;_lastDirectionY=null;_lastScrollX=0;_lastScrollY=0;_stopTimeout=null;_isMoving=!1;_lastActivityTime=0;_pendingActions=new Map;_rafScheduled=!1;_rafId=null;_wheelAccumulatorX=0;_wheelAccumulatorY=0;_wheelRafId=null;_scrollRafId=null;_lastPointerX=0;_lastPointerY=0;_activatedDirections=new Set;_targetProgress=0;_currentProgress=0;_interpolationRafId=null;_siblings=null;_index=0;static _sequenceStates=new WeakMap;_boundHandlers={};_frozenHoverRect=null;_gestureHoverActive=!1;_boundHoverMoveHandler=null;constructor(J,$){super(J,$);this._tolerance=$.tolerance??1,this._dragMinimum=$.dragMinimum??10,this._dragMinimumSquared=this._dragMinimum*this._dragMinimum,this._wheelSpeed=$.wheelSpeed??1,this._scrollSpeed=$.scrollSpeed??1,this._stopDelay=$.stopDelay??150,this._preventDefault=$.preventDefault??!1,this._lockAxis=$.lockAxis??!1,this._animationStep=$.animationStep??0.1,this._smooth=Math.max(0,Math.min(1,$.smooth??0));let Q=$;if(Q._siblings&&Q._index!==void 0){if(this._siblings=Q._siblings,this._index=Q._index,!F0._sequenceStates.has(this._siblings))F0._sequenceStates.set(this._siblings,{lastIndex:0})}}_onEnable(){let J=this._resolveElement(this._config.target,window);this._target=J??window;let $=this._config.types;if($.includes("pointer"))this._addPointerListeners();if($.includes("touch"))this._addTouchListeners();if($.includes("wheel"))this._addWheelListener();if($.includes("scroll"))this._addScrollListener();if(this._config.events.Hover||this._config.events.HoverEnd)this._addHoverListeners()}_onDisable(){if(this._stopTimeout)clearTimeout(this._stopTimeout),this._stopTimeout=null;if(this._rafId!==null)cancelAnimationFrame(this._rafId),this._rafId=null;if(this._wheelRafId!==null)cancelAnimationFrame(this._wheelRafId),this._wheelRafId=null;if(this._scrollRafId!==null)cancelAnimationFrame(this._scrollRafId),this._scrollRafId=null;if(this._interpolationRafId!==null)cancelAnimationFrame(this._interpolationRafId),this._interpolationRafId=null;this._rafScheduled=!1,this._pendingActions.clear();let J=this._target;if(this._boundHandlers.pointerDown)J.removeEventListener("pointerdown",this._boundHandlers.pointerDown),window.removeEventListener("pointermove",this._boundHandlers.pointerMove),window.removeEventListener("pointerup",this._boundHandlers.pointerUp);if(this._boundHandlers.touchStart)J.removeEventListener("touchstart",this._boundHandlers.touchStart),window.removeEventListener("touchmove",this._boundHandlers.touchMove),window.removeEventListener("touchend",this._boundHandlers.touchEnd);if(this._boundHandlers.wheel)J.removeEventListener("wheel",this._boundHandlers.wheel);if(this._boundHandlers.scroll)(this._target===window?window:this._target).removeEventListener("scroll",this._boundHandlers.scroll);if(this._boundHoverMoveHandler)window.removeEventListener("mousemove",this._boundHoverMoveHandler),this._boundHoverMoveHandler=null;this._frozenHoverRect=null,this._gestureHoverActive=!1,this._boundHandlers={}}_addPointerListeners(){this._boundHandlers.pointerDown=this._handlePointerDown.bind(this),this._boundHandlers.pointerMove=this._handlePointerMove.bind(this),this._boundHandlers.pointerUp=this._handlePointerUp.bind(this);let J={passive:!this._preventDefault};this._target.addEventListener("pointerdown",this._boundHandlers.pointerDown,J),window.addEventListener("pointermove",this._boundHandlers.pointerMove,J),window.addEventListener("pointerup",this._boundHandlers.pointerUp)}_handlePointerDown(J){if(J.pointerType==="touch"&&this._config.types.includes("touch"))return;if(this._preventDefault)J.preventDefault();this._handleInputStart(J.clientX,J.clientY)}_handlePointerMove(J){if(J.pointerType==="touch"&&this._config.types.includes("touch"))return;if(this._handleInputMove(J.clientX,J.clientY)){if(this._preventDefault)J.preventDefault()}}_handlePointerUp(J){if(J.pointerType==="touch"&&this._config.types.includes("touch"))return;this._handleInputEnd()}_addTouchListeners(){this._boundHandlers.touchStart=this._handleTouchStart.bind(this),this._boundHandlers.touchMove=this._handleTouchMove.bind(this),this._boundHandlers.touchEnd=this._handleTouchEnd.bind(this);let J={passive:!this._preventDefault};this._target.addEventListener("touchstart",this._boundHandlers.touchStart,J),window.addEventListener("touchmove",this._boundHandlers.touchMove,J),window.addEventListener("touchend",this._boundHandlers.touchEnd)}_handleTouchStart(J){if(this._preventDefault)J.preventDefault();let $=J.touches[0];if(!$)return;this._handleInputStart($.clientX,$.clientY)}_handleTouchMove(J){let $=J.touches[0];if(!$)return;if(this._handleInputMove($.clientX,$.clientY)){if(this._preventDefault)J.preventDefault()}}_handleTouchEnd(J){this._handleInputEnd()}_handleInputStart(J,$){this._fireEvent("PressInit"),this._startX=J,this._startY=$,this._lastPointerX=J,this._lastPointerY=$,this._deltaX=0,this._deltaY=0,this._isPressed=!0,this._isDragging=!1,this._lockedAxis=null,this._fireEvent("Press")}_handleInputMove(J,$){if(!this._isPressed)return!1;let Q=J-this._lastPointerX,q=$-this._lastPointerY;if(Math.abs(Q)<1&&Math.abs(q)<1)return!1;this._lastPointerX=J,this._lastPointerY=$;let Z=J-this._startX,j=$-this._startY;if(this._updateDeltas(Z,j),this._checkDragStart(),this._checkDirectionAndFire(!1),this._checkToggle(Z,j),this._scheduleStopCheck(),this._isDragging)this._fireEvent("Drag");return!0}_handleInputEnd(){if(!this._isPressed)return;if(this._isDragging)this._fireEvent("DragEnd");this._fireEvent("Release"),this._fireCompleteCallbacks(),this._fireEvent("Stop"),this._resetGestureState()}_addWheelListener(){this._boundHandlers.wheel=this._handleWheel.bind(this),this._target.addEventListener("wheel",this._boundHandlers.wheel,{passive:!this._preventDefault})}_handleWheel(J){if(this._preventDefault)J.preventDefault();if(this._wheelAccumulatorX+=J.deltaX*this._wheelSpeed,this._wheelAccumulatorY+=J.deltaY*this._wheelSpeed,this._wheelRafId!==null)return;this._wheelRafId=requestAnimationFrame(()=>{this._wheelRafId=null,this._deltaX=this._wheelAccumulatorX,this._deltaY=this._wheelAccumulatorY,this._wheelAccumulatorX=0,this._wheelAccumulatorY=0,this._checkDirectionAndFire(!0),this._checkToggle(this._deltaX,this._deltaY),this._scheduleStopCheck(),this._deltaX=0,this._deltaY=0})}_addScrollListener(){if(this._boundHandlers.scroll=this._handleScroll.bind(this),this._target===window)this._lastScrollX=window.scrollX,this._lastScrollY=window.scrollY;else{let J=this._target;this._lastScrollX=J.scrollLeft,this._lastScrollY=J.scrollTop}this._target.addEventListener("scroll",this._boundHandlers.scroll,{passive:!0})}_handleScroll(){if(this._scrollRafId!==null)return;this._scrollRafId=requestAnimationFrame(()=>{this._scrollRafId=null,this._processScroll()})}_processScroll(){let J,$;if(this._target===window)J=window.scrollX,$=window.scrollY;else{let Z=this._target;J=Z.scrollLeft,$=Z.scrollTop}let Q=(J-this._lastScrollX)*this._scrollSpeed,q=($-this._lastScrollY)*this._scrollSpeed;this._lastScrollX=J,this._lastScrollY=$,this._deltaX=Q,this._deltaY=q,this._checkDirectionAndFire(!0),this._checkToggle(Q,q),this._scheduleStopCheck(),this._deltaX=0,this._deltaY=0}_addHoverListeners(){if(this._target===window)return;let J=this._target;this._frozenHoverRect=u(J),this._boundHoverMoveHandler=($)=>{if(!this._frozenHoverRect)return;let Q=this._frozenHoverRect,q=$.clientX>=Q.left&&$.clientX<=Q.right&&$.clientY>=Q.top&&$.clientY<=Q.bottom;if(q&&!this._gestureHoverActive)this._gestureHoverActive=!0,this._fireEvent("Hover");else if(!q&&this._gestureHoverActive)this._gestureHoverActive=!1,this._fireEvent("HoverEnd")},window.addEventListener("mousemove",this._boundHoverMoveHandler)}refresh(){if(this._target===window||!this._frozenHoverRect)return;this._frozenHoverRect=u(this._target)}_updateDeltas(J,$){if(this._lockAxis&&this._lockedAxis)if(this._lockedAxis==="x")this._deltaX=J,this._deltaY=0;else this._deltaX=0,this._deltaY=$;else this._deltaX=J,this._deltaY=$;if(this._lockAxis&&!this._lockedAxis){let Q=this._tolerance;if(Math.abs(this._deltaX)>Q||Math.abs(this._deltaY)>Q)this._lockedAxis=Math.abs(this._deltaX)>Math.abs(this._deltaY)?"x":"y"}}_checkDirectionAndFire(J){let $=this._tolerance;if(J||!this._lockedAxis||this._lockedAxis==="y"){if(this._deltaY<-$){if(this._fireEvent("Up"),!J)this._activatedDirections.add("Up")}if(this._deltaY>$){if(this._fireEvent("Down"),!J)this._activatedDirections.add("Down")}}if(J||!this._lockedAxis||this._lockedAxis==="x"){if(this._deltaX<-$){if(this._fireEvent("Left"),!J)this._activatedDirections.add("Left")}if(this._deltaX>$){if(this._fireEvent("Right"),!J)this._activatedDirections.add("Right")}}if(Math.abs(this._deltaX)>$||Math.abs(this._deltaY)>$){if(this._fireEvent("Change"),Math.abs(this._deltaX)>$)this._fireEvent("ChangeX");if(Math.abs(this._deltaY)>$)this._fireEvent("ChangeY")}}_checkToggle(J,$){let Q=this._tolerance;if(Math.abs(J)>=Q){let q=J>0?1:-1;if(this._lastDirectionX!==null&&q!==this._lastDirectionX)this._fireEvent("ToggleX");this._lastDirectionX=q}if(Math.abs($)>=Q){let q=$>0?1:-1;if(this._lastDirectionY!==null&&q!==this._lastDirectionY)this._fireEvent("ToggleY");this._lastDirectionY=q}}_checkDragStart(){if(this._isDragging)return;if(this._deltaX*this._deltaX+this._deltaY*this._deltaY>this._dragMinimumSquared)this._isDragging=!0}_scheduleStopCheck(){if(this._isMoving=!0,this._lastActivityTime=performance.now(),this._stopTimeout)return;let J=()=>{let $=performance.now()-this._lastActivityTime;if($>=this._stopDelay){if(this._stopTimeout=null,this._isMoving){if(this._isMoving=!1,this._lastDirectionX=null,this._lastDirectionY=null,!this._isPressed)this._fireEvent("Stop")}}else this._stopTimeout=setTimeout(J,this._stopDelay-$)};this._stopTimeout=setTimeout(J,this._stopDelay)}_fireEvent(J){let $=this._config.events[J];if($)this._pendingActions.set($,J),this._scheduleRAF()}_scheduleRAF(){if(this._rafScheduled)return;this._rafScheduled=!0,this._rafId=requestAnimationFrame(()=>{this._rafScheduled=!1,this._rafId=null;for(let[J,$]of this._pendingActions)this._executeAction(J,$);this._pendingActions.clear()})}_getStepForEvent(J){if(typeof this._animationStep==="number")return this._animationStep;if(J&&this._animationStep[J]!==void 0)return this._animationStep[J];let $=Object.values(this._animationStep);return $.length>0?$[0]:0.1}_executeAction(J,$){switch(J){case"play":case"pause":case"reverse":case"restart":case"reset":case"complete":w(J,this._timeline);break;case"toggle":if(this._timeline.isActive())this._timeline.pause();else this._timeline.play();break;case"kill":this._timeline.kill();break;case"playReverse":{let Q=this._timeline.progress();if(Q>=1)this._timeline.reverse();else if(Q<=0)this._timeline.play();else if(!this._timeline.isActive())if(this._timeline.reversed())this._timeline.play();else this._timeline.reverse();break}case"progressUp":this._interpolateProgress(this._getStepForEvent($));break;case"progressDown":this._interpolateProgress(-this._getStepForEvent($));break;case"playNext":this._playSequenceItem(1);break;case"playPrevious":this._playSequenceItem(-1);break}}_playSequenceItem(J){if(!this._siblings||this._siblings.length===0)return;let $=F0._sequenceStates.get(this._siblings);if(!$)return;let Q=this._siblings.length,q=$.lastIndex,Z=(q+J+Q)%Q,j=this._siblings[q];if(j&&j.progress()>0)j.reverse();let G=this._siblings[Z];if(G)G.restart();$.lastIndex=Z}_interpolateProgress(J){let $=this._timeline.progress();if(Math.abs($-this._currentProgress)>0.01)this._currentProgress=$,this._targetProgress=$;if(this._interpolationRafId===null)this._currentProgress=$,this._targetProgress=$;if(this._targetProgress=Math.max(0,Math.min(1,this._targetProgress+J)),this._smooth===0){this._currentProgress=this._targetProgress,this._timeline.progress(this._currentProgress);return}if(this._interpolationRafId===null)this._startInterpolationLoop()}_startInterpolationLoop(){if(this._interpolationRafId!==null)return;let J=0.08+(1-this._smooth)*0.12,$=()=>{let Q=this._targetProgress-this._currentProgress;if(Math.abs(Q)<0.0001){this._currentProgress=this._targetProgress,this._timeline.progress(this._currentProgress),this._interpolationRafId=null;return}this._currentProgress+=Q*J,this._timeline.progress(this._currentProgress),this._interpolationRafId=requestAnimationFrame($)};this._interpolationRafId=requestAnimationFrame($)}_fireCompleteCallbacks(){if(this._activatedDirections.has("Up"))this._fireEvent("UpComplete");if(this._activatedDirections.has("Down"))this._fireEvent("DownComplete");if(this._activatedDirections.has("Left"))this._fireEvent("LeftComplete");if(this._activatedDirections.has("Right"))this._fireEvent("RightComplete");this._activatedDirections.clear()}_resetGestureState(){this._isPressed=!1,this._isDragging=!1,this._deltaX=0,this._deltaY=0,this._lockedAxis=null,this._lastDirectionX=null,this._lastDirectionY=null,this._activatedDirections.clear()}}I.registerTrigger("gesture",F0);var w0=null;function pJ(J,$,Q,q){let Z=J;if(!Z.style)return;let j=N0();if(y($))if(P(J,$,Q,q),j)x0(J);else Z.style.transform=R(J);else{let G=q?`${Q}${q}`:`${Q}`;if(j)V0(J,$,G);else try{if(j0($))Z.style.setProperty($,G);else if($ in Z.style)Z.style[$]=G;else Z.style.setProperty(o($),G)}catch{}}}function cJ(J,$,Q,q,Z,j){let G=J;if(!G.style)return;let z=j===1?`rgb(${Math.round(Q)}, ${Math.round(q)}, ${Math.round(Z)})`:`rgba(${Math.round(Q)}, ${Math.round(q)}, ${Math.round(Z)}, ${j})`;if(N0())V0(J,$,z);else try{if(j0($))G.style.setProperty($,z);else if($ in G.style)G.style[$]=z;else G.style.setProperty(o($),z)}catch{}}function mJ(J,$,Q,q){let Z=J;if(!Z.style)return;if(w0||(w0=U.filter)){let j=w0.interpolateFilters($,Q,q),G=w0.filterToString(j);if(N0())V0(J,"filter",G);else Z.style.filter=G}}function gJ(J,$,Q){let{pathLUT:q,alignOffset:Z,pathOffset:j,pathRotate:G}=Q;if(!q||q.length===0)return;let z=$*(q.length-1),W=Math.floor(z),B=Math.min(W+1,q.length-1),N=z-W,_=q[W],X=q[B],H=_.x+(X.x-_.x)*N,Y=_.y+(X.y-_.y)*N,F=(j?.x??0)+H-(Z?.x??0),K=(j?.y??0)+Y-(Z?.y??0);if(P(J,"x",F,"px"),P(J,"y",K,"px"),G){let L=s6(_.angle,X.angle,N);P(J,"rotate",L,"deg")}if(N0())x0(J);else J.style.transform=R(J)}function s6(J,$,Q){let q=$-J;if(q>180)q-=360;if(q<-180)q+=360;return J+q*Q}var _J=null,l6=100,o6=500,i6=0.5,A0=[],n6=50;function a6(J){for(let $=0;$<A0.length;$++)if(A0[$].length>=J){let Q=A0.splice($,1)[0];return Q.length=J,Q}return Array(J)}function r6(J){if(A0.length<n6)A0.push(J)}class HJ{target=null;property="";startValue=0;endValue=0;change=0;unit="";next=null;valueType="scalar";startColor=null;endColor=null;changeColor=new Float32Array(4);startFilters=null;endFilters=null;startDraw=null;endDraw=null;pathLength=0;pathData=null;motionPathLength=0;startProgress=0;endProgress=0;pathRotate=!1;alignOffset=null;pathOffset=null;pathLUT=null;_isElement=!1;init(J,$,Q,q,Z=""){return this.target=J,this.property=$,this.startValue=Q,this.endValue=q,this.change=q-Q,this.unit=Z,this.valueType="scalar",this._isElement=J instanceof Element,this}initColor(J,$,Q,q){return this.target=J,this.property=$,this.valueType="color",this.startColor=Q,this.endColor=q,this.changeColor[0]=q[0]-Q[0],this.changeColor[1]=q[1]-Q[1],this.changeColor[2]=q[2]-Q[2],this.changeColor[3]=q[3]-Q[3],this._isElement=J instanceof Element,this}initFilter(J,$,Q,q){return this.target=J,this.property=$,this.valueType="filter",this.startFilters=Q,this.endFilters=q,this._isElement=J instanceof Element,this}initDrawSVG(J,$,Q,q,Z){return this.target=J,this.property=$,this.valueType="drawSVG",this.startDraw=Q,this.endDraw=q,this.pathLength=Z,this._isElement=J instanceof Element,this}initPath(J,$,Q,q,Z,j,G,z,W){if(J instanceof Element)S(J,!0);this.target=J,this.property=$,this.valueType="path",this.pathData=Q,this.motionPathLength=q,this.startProgress=Z,this.endProgress=j,this.pathRotate=G,this.alignOffset=z,this.pathOffset=W,this._isElement=J instanceof Element;let B=Math.abs(j-Z),N=q*B,_=Math.min(o6,Math.max(l6,Math.ceil(N*i6)));this.pathLUT=a6(_+1);for(let X=0;X<=_;X++){let H=X/_,Y=Z+(j-Z)*H;this.pathLUT[X]=ZJ(Q,Y,G)}return this}render(J){if(!this.target)return;if(this.valueType==="color"&&this.startColor){let $=this.startColor[0]+this.changeColor[0]*J,Q=this.startColor[1]+this.changeColor[1]*J,q=this.startColor[2]+this.changeColor[2]*J,Z=this.startColor[3]+this.changeColor[3]*J;if(this._isElement)cJ(this.target,this.property,$,Q,q,Z)}else if(this.valueType==="filter"&&this.startFilters&&this.endFilters){if(this._isElement)mJ(this.target,this.startFilters,this.endFilters,J)}else if(this.valueType==="drawSVG"&&this.startDraw&&this.endDraw){if(this._isElement&&this.pathLength>0){let $=this.startDraw.start+(this.endDraw.start-this.startDraw.start)*J,Q=this.startDraw.end+(this.endDraw.end-this.startDraw.end)*J;if(_J||(_J=U.drawSVG))_J.applyDrawSVG(this.target,$,Q,this.pathLength)}}else if(this.valueType==="path"&&this.pathLUT&&this.pathLUT.length>0){if(this._isElement)gJ(this.target,J,{pathLUT:this.pathLUT,alignOffset:this.alignOffset??{x:0,y:0},pathOffset:this.pathOffset??{x:0,y:0},pathRotate:this.pathRotate})}else{let $=this.startValue+this.change*J;if(this._isElement)pJ(this.target,this.property,$,this.unit);else this.target[this.property]=$}}reset(){if(this.target=null,this.property="",this.startValue=0,this.endValue=0,this.change=0,this.unit="",this.next=null,this.valueType="scalar",this.startColor=null,this.endColor=null,this.startFilters=null,this.endFilters=null,this.startDraw=null,this.endDraw=null,this.pathLength=0,this.pathData=null,this.motionPathLength=0,this.startProgress=0,this.endProgress=0,this.pathRotate=!1,this.alignOffset=null,this.pathOffset=null,this.pathLUT)r6(this.pathLUT);this.pathLUT=null,this._isElement=!1}}class I0{pool=[];totalCreated=0;factory;maxSize;constructor(J,$){this.factory=J,this.maxSize=$}acquire(){if(this.pool.length>0)return this.pool.pop();return this.totalCreated++,this.factory()}release(J){if(J.reset(),this.maxSize===void 0||this.pool.length<this.maxSize)this.pool.push(J)}getPoolSize(){return this.pool.length}getTotalCreated(){return this.totalCreated}clear(){this.pool=[]}}var O0=new I0(()=>new HJ,500),e={acquire:()=>O0.acquire(),release:(J)=>O0.release(J),getPoolSize:()=>O0.getPoolSize(),getTotalCreated:()=>O0.getTotalCreated(),clear:()=>O0.clear()};var sJ={x:0,y:0,z:0,rotate:0,rotateX:0,rotateY:0,rotateZ:0,scale:1,scaleX:1,scaleY:1,scaleZ:1,skewX:0,skewY:0,opacity:1};class d{static _createAnimationCallback=null;static setCreateAnimationCallback(J){d._createAnimationCallback=J}_targets;_originalTargets;_fromVars;_toVars;_duration=0.5;_delay=0;_ease="power1.out";_animation=null;_animations=[];_built=!1;_splitType;_mask;_repeat;_repeatDelay;_yoyo;_stagger;_axis;_fitConfig;_onStart;_onUpdate;_onComplete;_onRepeat;_onReverseComplete;_skipInitialFromRender=!1;_plainObjectInitialValues=new Map;_expectedAnimationIds=[];_propsToAnimate=[];constructor(J,$){if(this._targets=k0(J),this._originalTargets=this._targets,this._targets.length===0&&typeof J==="string")console.warn(`[Motion] Selector "${J}" matched no elements. Animation will not run.`);if($)this._applyAnimationConfig($)}_applyAnimationConfig(J){if(J.from)this._fromVars=J.from;if(J.to)this._toVars=J.to;if(J.duration!==void 0)if(typeof J.duration!=="number"||!isFinite(J.duration)||J.duration<0)console.warn(`[Motion] Invalid duration: ${J.duration}. Must be a finite number >= 0. Using default.`);else this._duration=J.duration;if(J.delay!==void 0)if(typeof J.delay!=="number"||isNaN(J.delay))console.warn(`[Motion] Invalid delay: ${J.delay}. Must be a number. Using default 0.`);else if(!isFinite(J.delay))console.warn(`[Motion] Invalid delay: ${J.delay}. Infinity is not a valid delay. Using default 0.`);else this._delay=J.delay;if(J.ease)this._ease=J.ease;if(J.split)this._splitType=J.split;if(J.mask)this._mask=J.mask;if(J.stagger!==void 0)this._stagger=J.stagger;if(J.axis)this._axis=J.axis;if(J.fit)this._fitConfig=J.fit;if(J.repeat)if(typeof J.repeat==="number")this._repeat=J.repeat;else this._repeat=J.repeat.times,this._repeatDelay=J.repeat.delay,this._yoyo=J.repeat.yoyo;if(J.onStart)this._onStart=J.onStart;if(J.onUpdate)this._onUpdate=J.onUpdate;if(J.onComplete)this._onComplete=J.onComplete;if(J.onRepeat)this._onRepeat=J.onRepeat;if(J.onReverseComplete)this._onReverseComplete=J.onReverseComplete}_capturePlainObjectValues(J){for(let $ of this._targets){if($ instanceof Element)continue;let Q=$,q={};for(let Z of J)if(Z in Q&&typeof Q[Z]==="number")q[Z]=Q[Z];if(Object.keys(q).length>0)this._plainObjectInitialValues.set($,q)}}_restorePlainObjectValues(){for(let[J,$]of this._plainObjectInitialValues){let Q=J;for(let[q,Z]of Object.entries($))Q[q]=Z}}_ensureBuilt(){if(!this._built)this._build()}_isInvalidated(){if(this._animations.length===0)return!1;return this._animations.some((J,$)=>{let Q=J.getId(),q=this._expectedAnimationIds[$];return Q===0||Q!==q})}rebuildIfPooled(){if(this._isInvalidated()){this._restorePlainObjectValues();for(let J of this._targets)if(J instanceof Element)S(J),U.styleReset?.clearAnimationStylesForProps?.(J,this._propsToAnimate);this._resetBuildState(),this._ensureBuilt()}}_build(){if(this._built)return;if(this._targets.length===0)return;if(!this._fromVars&&!this._toVars&&!this._fitConfig&&this._duration<=0)return;if(this._fitConfig){if(!U.fit){console.warn("[Motion] FitResolver not loaded. Did you import the SDK?");return}if(this._built=!0,!d._createAnimationCallback)throw Error("AnimationBuilder: Engine not initialized. Call Engine.init() first.");let j={};if(this._repeat!==void 0)j.repeat=this._repeat;if(this._repeatDelay!==void 0)j.repeatDelay=this._repeatDelay;if(this._yoyo)j.yoyo=this._yoyo;if(this._onStart)j.onStart=this._onStart;if(this._onUpdate)j.onUpdate=this._onUpdate;if(this._onComplete)j.onComplete=this._onComplete;if(this._onRepeat)j.onRepeat=this._onRepeat;if(this._onReverseComplete)j.onReverseComplete=this._onReverseComplete;if(this._stagger!==void 0)j.stagger=this._stagger;let G=[];for(let W of this._targets){if(!(W instanceof Element))continue;let B=d._createAnimationCallback([W],{},this._duration,this._delay,this._ease,!1,void 0,j);if(Array.isArray(B))G.push(...B);else G.push(B)}let z=this._fitConfig;for(let W of G)for(let B of W.getTargets())if(B instanceof Element)U.fit.registerPendingSetup(W,B,z,e);this._animation=G[0]??null,this._animations=G,this._expectedAnimationIds=G.map((W)=>W.getId());return}this._built=!0;let J={},$=!1,Q;if(this._fromVars&&this._toVars){J={...this._toVars},Q={...this._fromVars},$=!0;for(let j of Object.keys(Q))if(!(j in J)){if(j in sJ)J[j]=sJ[j];else if(Z0(j))J[j]="";else if(a(j))J[j]=""}}else if(this._fromVars)J={...this._fromVars},$=!0;else if(this._toVars)J={...this._toVars};if(this._splitType&&U.textSplitter?.split){let j=this._mask?{mask:!0}:void 0,G=[];for(let z of this._originalTargets)if(z instanceof Element){let W=U.textSplitter?.split(z,this._splitType,j);G.push(...W)}if(G.length>0)this._targets=G}if(this._propsToAnimate=Object.keys(J),Q){for(let j of Object.keys(Q))if(!this._propsToAnimate.includes(j))this._propsToAnimate.push(j)}if(this._plainObjectInitialValues.size===0)this._capturePlainObjectValues(this._propsToAnimate);if($){for(let j of this._targets)if(j instanceof Element)S(j),U.styleReset?.clearAnimationStylesForProps?.(j,this._propsToAnimate)}if(U.styleReset?.registerAnimatedProps){for(let j of this._targets)if(j instanceof Element)U.styleReset?.registerAnimatedProps(j,this._propsToAnimate)}let q={repeat:this._repeat,repeatDelay:this._repeatDelay,yoyo:this._yoyo,stagger:this._stagger,onStart:this._onStart,onUpdate:this._onUpdate,onComplete:this._onComplete,onRepeat:this._onRepeat,onReverseComplete:this._onReverseComplete,_skipInitialRender:this._skipInitialFromRender||void 0};if(!d._createAnimationCallback)throw Error("AnimationBuilder: Engine not initialized. Call AnimationBuilder.setCreateAnimationCallback first.");let Z=d._createAnimationCallback(this._targets,J,this._duration,this._delay,this._ease,$,Q,q);if(Array.isArray(Z))this._animations=Z,this._animation=Z[0]||null;else this._animation=Z,this._animations=[Z];this._expectedAnimationIds=this._animations.map((j)=>j.getId())}getAnimation(){return this._ensureBuilt(),this._animation}getAnimations(){return this._ensureBuilt(),this._animations}getTargets(){return this._targets}getOriginalTargets(){return this._originalTargets}hasSplit(){return!!this._splitType}_resetBuildState(){this._built=!1,this._animations=[],this._animation=null,this._expectedAnimationIds=[]}getConfig(){return{fromVars:this._fromVars?{...this._fromVars}:void 0,toVars:this._toVars?{...this._toVars}:void 0,duration:this._duration,delay:this._delay,ease:this._ease,axis:this._axis,fit:this._fitConfig?{...this._fitConfig}:void 0,split:this._splitType,mask:this._mask,stagger:this._stagger,repeat:this._repeat,repeatDelay:this._repeatDelay,yoyo:this._yoyo,onStart:this._onStart,onUpdate:this._onUpdate,onComplete:this._onComplete,onRepeat:this._onRepeat,onReverseComplete:this._onReverseComplete}}setAxis(J){this._axis=J}getAxis(){return this._axis}setSkipInitialFromRender(J){this._skipInitialFromRender=J}}class P0{static parse(J,$,Q,q){if(J===void 0)return $;if(typeof J==="number")return J;let Z=J.trim();if(Z==="<")return Q;if(Z===">")return q;if(Z.startsWith("<")){let j=parseFloat(Z.substring(1));if(!isNaN(j))return Q+j}if(Z.startsWith(">")){let j=parseFloat(Z.substring(1));if(!isNaN(j))return q+j}if(Z.startsWith("+=")){let j=parseFloat(Z.substring(2));return $+j}if(Z.startsWith("-=")){let j=parseFloat(Z.substring(2));return $-j}return console.warn(`Invalid position parameter: "${Z}", using current end`),$}}class b{static _eachCounter=0;static _registerWithEngine=null;static setEngineRegisterCallback(J){b._registerWithEngine=J}_name;_children=[];_duration=0;_time=0;_progress=0;_timeScale=1;_isActive=!1;_isReversed=!1;_killed=!1;_atZeroState=!1;_repeat=0;_repeatDelay=0;_yoyo=!1;_currentRepeat=0;_completeFired=!1;_inRepeatDelay=!1;_repeatDelayCounter=0;_onStart;_onUpdate;_onComplete;_onRepeat;_startFired=!1;_trigger;_unregisterCallback;setUnregisterCallback(J){this._unregisterCallback=J}_previousStart=0;_previousEnd=0;_eachInstances;_eachDuration;_initialValues=new Map;_initialTransforms=new Map;_transformElements=new Set;_savedTransitions=new Map;_transitionsDisabled=!1;_savedWillChange=new Map;_willChangeApplied=!1;_splitParentOverrides=new Map;constructor(J,$){if(this._name=J,$?.repeat!==void 0)if(typeof $.repeat==="number")this._repeat=$.repeat;else this._repeat=$.repeat.times,this._repeatDelay=$.repeat.delay??0,this._yoyo=$.repeat.yoyo??!1;if($?.onStart)this._onStart=$.onStart;if($?.onUpdate)this._onUpdate=$.onUpdate;if($?.onComplete)this._onComplete=$.onComplete;if($?.onRepeat)this._onRepeat=$.onRepeat;if(J&&b._registerWithEngine)b._registerWithEngine(J,this)}duration(){if(this._eachDuration!==void 0)return this._eachDuration;return this._duration}totalDuration(){if(this._repeat===-1)return 1/0;return this._duration*(this._repeat+1)+this._repeatDelay*this._repeat}clear(){for(let J of this._children)if(J.type==="animation")J.child.kill();else if(J.type==="timeline")J.child.kill();return this._children=[],this._duration=0,this._time=0,this._progress=0,this._isActive=!1,this._isReversed=!1,this._startFired=!1,this._previousStart=0,this._previousEnd=0,this._initialValues.clear(),this._initialTransforms.clear(),this._transformElements.clear(),this._splitParentOverrides.clear(),this._clearTransitionData(),this._currentRepeat=0,this._completeFired=!1,this._inRepeatDelay=!1,this._repeatDelayCounter=0,this}_captureInitialValues(J){let $=J.getTargets(),Q=J.getFirstPropTween();while(Q){let q=Q.property;for(let Z of $){if(!(Z instanceof Element))continue;let j=this._initialValues.get(Z);if(!j)j=new Map,this._initialValues.set(Z,j);if(!j.has(q)){let G=Z;if(y(q)||GJ(q)){if(this._transformElements.add(Z),!this._initialTransforms.has(Z)){let z=G.style.transform;this._initialTransforms.set(Z,z||null)}j.set(q,{removeInline:!0})}else if(Z0(q)||a(q))j.set(q,{removeInline:!0});else{let z=q.replace(/([A-Z])/g,"-$1").toLowerCase();if(G.style.getPropertyValue(z)!==""){let B=yJ(Z,q);j.set(q,{removeInline:!1,value:B.value,unit:B.unit})}else j.set(q,{removeInline:!0})}}}Q=Q.next}}_restoreInitialValues(){for(let J of this._transformElements){let $=J;S(J);let Q=this._initialTransforms.get(J);if(Q)$.style.transform=Q;else $.style.removeProperty("transform")}for(let[J,$]of this._initialValues){let Q=J;for(let[q,Z]of $){if(y(q))continue;let j=q.replace(/([A-Z])/g,"-$1").toLowerCase();if(Z.removeInline)Q.style.removeProperty(j);else{let G=`${Z.value}${Z.unit}`;Q.style.setProperty(j,G)}}}}_disableTransitions(){if(this._transitionsDisabled)return;for(let J of this._savedTransitions.keys())J.style.transition="none";this._transitionsDisabled=!0}_applyWillChange(){if(this._willChangeApplied)return;for(let J of this._savedWillChange.keys())J.style.willChange="transform";this._willChangeApplied=!0}_restoreTransitions(){if(!this._transitionsDisabled)return;for(let[J,$]of this._savedTransitions)J.style.transition=$;this._transitionsDisabled=!1}_clearTransitionData(){this._restoreTransitions(),this._savedTransitions.clear(),this._transitionsDisabled=!1,this._restoreWillChange()}_restoreWillChange(){if(this._willChangeApplied)for(let[J,$]of this._savedWillChange)if($)J.style.willChange=$;else J.style.removeProperty("will-change");this._savedWillChange.clear(),this._willChangeApplied=!1}_addEntry(J,$,Q){let q=P0.parse(Q,this._duration,this._previousStart,this._previousEnd),Z=new d(J,$);return this._addBuilder(Z,q)}_addBuilder(J,$){J.setSkipInitialFromRender(!0);let Q=J.getAnimations();if(Q.length===0)return this;let q=$;for(let Z of Q){let j=Z.getDelay(),G=$+j;Z.clearDelay();let z=Z.totalDuration(),W={type:"animation",child:Z,builder:J,startTime:G,duration:z};this._children.push(W),Z.setTimelineChild(!0),Z.pause(),this._captureInitialValues(Z);for(let _ of Z.getTargets())if(_ instanceof HTMLElement&&!this._savedTransitions.has(_))this._savedTransitions.set(_,_.style.transition);for(let _ of Z.getTargets())if(_ instanceof HTMLElement&&this._transformElements.has(_)&&!this._savedWillChange.has(_))this._savedWillChange.set(_,_.style.willChange);let B=!!J.getConfig().fromVars;if(G>0&&!B)Z.setLazyStartCapture(!0);if(B)Z.renderAtTime(0);if(J.hasSplit()){for(let _ of J.getOriginalTargets())if(_ instanceof Element){let X=_;if(!this._splitParentOverrides.has(X))this._splitParentOverrides.set(X,X.style.opacity);X.style.opacity="1"}}let N=G+z;if(N>q)q=N}if(this._previousStart=$,this._previousEnd=q,q>this._duration)this._duration=q;return this}call(J,$,Q){let q=P0.parse(Q,this._duration,this._previousStart,this._previousEnd),Z={type:"callback",child:J,startTime:q,duration:0,params:$};if(this._children.push(Z),this._previousStart=q,this._previousEnd=q,q>this._duration)this._duration=q;return this}_getFirstAnimationTarget(){let J=this._children[0];if(J?.type==="animation"&&J.builder){let Q=J.builder,q=Q.hasSplit()?Q.getOriginalTargets():Q.getTargets();for(let Z of q)if(K0(Z))return Z}let $=this.getFirstChildAnimation();if($){let Q=$.getTargets();for(let q of Q)if(K0(q))return q}return}_getAllAnimationTargets(){let J=[],$=new Set,Q=new Set;for(let q of this._children)if(q.type==="animation"&&q.builder){if(Q.has(q.builder))continue;Q.add(q.builder);let Z=q.builder.hasSplit()?q.builder.getOriginalTargets():q.builder.getTargets();for(let j of Z)if(K0(j)&&!$.has(j))$.add(j),J.push(j)}return J}_createInstanceForElement(J,$){let q=`${this._name||"__each"}__each_${$}_${b._eachCounter++}`,Z=new b(q),j=new Set;for(let G of this._children)if(G.type==="animation"&&G.builder){if(j.has(G.builder))continue;if(j.add(G.builder),!(G.builder.hasSplit()?G.builder.getOriginalTargets():G.builder.getTargets()).filter((X)=>K0(X)).includes(J))continue;let W=G.builder.getConfig(),B=W.repeat!=null?{times:W.repeat,delay:W.repeatDelay,yoyo:W.yoyo}:void 0,N=G.builder.hasSplit(),_=new d(J,{from:W.fromVars,to:W.toVars,duration:W.duration,delay:W.delay,ease:W.ease,repeat:B,...N&&W.split?{split:W.split}:{},...N&&W.mask?{mask:W.mask}:{},...N&&W.stagger!==void 0?{stagger:W.stagger}:{},onStart:W.onStart,onUpdate:W.onUpdate,onComplete:W.onComplete,onRepeat:W.onRepeat,onReverseComplete:W.onReverseComplete});if(W.axis)_.setAxis(W.axis);Z._addBuilder(_,G.startTime)}else if(G.type==="callback")Z.call(G.child,G.params,G.startTime);return Z}_createInstanceForElements(J,$){let q=`${this._name||"__each"}__each_${$}_${b._eachCounter++}`,Z=new b(q),j=new Set;for(let G of this._children)if(G.type==="animation"&&G.builder){if(j.has(G.builder))continue;j.add(G.builder);let z=G.builder.getConfig(),W=z.repeat!=null?{times:z.repeat,delay:z.repeatDelay,yoyo:z.yoyo}:void 0,B=G.builder.hasSplit(),N=new d(J,{from:z.fromVars,to:z.toVars,duration:z.duration,delay:z.delay,ease:z.ease,repeat:W,...B&&z.split?{split:z.split}:{},...B&&z.mask?{mask:z.mask}:{},...B&&z.stagger!==void 0?{stagger:z.stagger}:{},onStart:z.onStart,onUpdate:z.onUpdate,onComplete:z.onComplete,onRepeat:z.onRepeat,onReverseComplete:z.onReverseComplete});if(z.axis)N.setAxis(z.axis);Z._addBuilder(N,G.startTime)}else if(G.type==="callback")Z.call(G.child,G.params,G.startTime);return Z}_resolveTargetElements(J){if(typeof J!=="string")return[J];if(typeof document<"u")try{return Array.from(document.querySelectorAll(J))}catch($){console.warn(`[Motion] Invalid selector "${J}":`,$)}return[]}_setupEachModeGeneric(J,$){if(J.length===0)return;if(this._eachInstances=[],this._children.some((q)=>q.type==="animation"&&q.builder?.hasSplit()))for(let q of J)U.textSplitter?.revert?.(q);this._clearTransitionData();for(let q=0;q<J.length;q++){let Z=J[q],j=this._createInstanceForElement(Z,q);$(j,Z),this._eachInstances.push(j)}{let q=null,Z=this._onUpdate,j=this._onStart,G=this._onComplete;for(let z of this._eachInstances){if(Z)z.onUpdate((W,B)=>{let N=W>0&&W<1;if(N)q=z;if(q===z){if(Z(W,B),!N)q=null}});if(j)z.onStart(()=>{q=z,j()});if(G)z.onComplete(()=>{if(q===z)q=null,G()})}}this._eachDuration=this._duration;for(let q of this._children)if(q.type==="animation"){let Z=q.child;Z.setTimelineChild(!1),Z.kill()}else if(q.type==="timeline")q.child.kill();this._children=[],this._duration=0,this._initialValues.clear(),this._initialTransforms.clear(),this._transformElements.clear(),this._splitParentOverrides.clear(),this._isActive=!1,this._time=0,this._progress=0,this._isReversed=!1,this._startFired=!1}_setupEachMode(J,$){let Q=U.triggerManager?.getInstance?.();if(!Q)return;let{each:q,...Z}=$;if($.target){let G=this._resolveTargetElements($.target);if(G.length===0)return;let z=this._getAllAnimationTargets();if(!z.every((N)=>G.some((_)=>_!==N&&_.contains(N)))){if(this._children.some((_)=>_.type==="animation"&&_.builder?.hasSplit()))for(let _ of z)U.textSplitter?.revert?.(_);this._setupEachModeGeneric(z,(_,X)=>{if(J==="scroll")Q.registerScroll(_,{...Z,target:X});else if(J==="hover")Q.registerHover(_,{...Z,target:X});else Q.registerClick(_,{...Z,target:X})});return}if(this._children.some((N)=>N.type==="animation"&&N.builder?.hasSplit()))for(let N of z)U.textSplitter?.revert?.(N);this._clearTransitionData(),this._eachInstances=[];for(let N=0;N<G.length;N++){let _=G[N],X=z.filter((Y)=>_.contains(Y));if(X.length===0)continue;let H=this._createInstanceForElements(X,N);if(J==="scroll")Q.registerScroll(H,{...Z,target:_});else if(J==="hover")Q.registerHover(H,{...Z,target:_});else Q.registerClick(H,{...Z,target:_});this._eachInstances.push(H)}{let N=null,_=this._onUpdate,X=this._onStart,H=this._onComplete;for(let Y of this._eachInstances){if(_)Y.onUpdate((F,K)=>{let L=F>0&&F<1;if(L)N=Y;if(N===Y){if(_(F,K),!L)N=null}});if(X)Y.onStart(()=>{N=Y,X()});if(H)Y.onComplete(()=>{if(N===Y)N=null,H()})}}this._eachDuration=this._duration;for(let N of this._children)if(N.type==="animation"){let _=N.child;_.setTimelineChild(!1),_.kill()}else if(N.type==="timeline")N.child.kill();this._children=[],this._duration=0,this._initialValues.clear(),this._initialTransforms.clear(),this._transformElements.clear(),this._splitParentOverrides.clear(),this._isActive=!1,this._time=0,this._progress=0,this._isReversed=!1,this._startFired=!1;return}let j=this._getAllAnimationTargets();this._setupEachModeGeneric(j,(G,z)=>{if(J==="scroll")Q.registerScroll(G,{...Z,target:z});else if(J==="hover")Q.registerHover(G,{...Z,target:z});else Q.registerClick(G,{...Z,target:z})})}onHover(J){if(J?.each)return this._setupEachMode("hover",J),this;let $=J?.target??this._getFirstAnimationTarget();return U.triggerManager?.getInstance?.().registerHover(this,{target:$,onLeave:J?.onLeave,leaveDelay:J?.leaveDelay}),this}onClick(J){if(J?.each)return this._setupEachMode("click",J),this;let $=J?.target??this._getFirstAnimationTarget();return U.triggerManager?.getInstance?.().registerClick(this,{target:$,secondTarget:J?.secondTarget,toggle:J?.toggle,preventDefault:J?.preventDefault}),this}onScroll(J){if(J?.each)return this._setupEachMode("scroll",J),this;let $=J?.target??this._getFirstAnimationTarget();return U.triggerManager?.getInstance?.().registerScroll(this,{...J,target:$}),this}onMouseMove(J){if(J?.each&&J.target)return this._setupMouseMoveEachMode(J),this;return U.triggerManager?.getInstance?.().registerMouseMove(this,{type:J?.type??"distance",target:J?.target,smooth:J?.smooth,startProgress:J?.startProgress,leaveProgress:J?.leaveProgress}),this}_setupMouseMoveEachMode(J){if(!J.target)return;let $=[];if(typeof J.target==="string"){if(typeof document<"u")$=Array.from(document.querySelectorAll(J.target))}else $=[J.target];let Q=U.triggerManager?.getInstance?.();if(!Q)return;this._setupEachModeGeneric($,(q,Z)=>{Q.registerMouseMove(q,{type:J.type??"distance",target:Z,smooth:J.smooth,startProgress:J.startProgress,leaveProgress:J.leaveProgress})})}onPageLoad(J){return U.triggerManager?.getInstance?.().registerPageLoad(this,J||{}),this}onPageExit(J){return U.triggerManager?.getInstance?.().registerPageExit(this,J||{}),this}onGesture(J){if(J.each)return this._setupGestureEachMode(J),this;return U.triggerManager?.getInstance?.().registerGesture(this,J),this}_setupGestureEachMode(J){let $=[];if(J.target)if(typeof J.target==="string"){if(typeof document<"u")$=Array.from(document.querySelectorAll(J.target))}else $=[J.target];else $=this._getAllAnimationTargets();if(this._setupEachModeGeneric($,()=>{}),!this._eachInstances||this._eachInstances.length===0)return;let Q=U.triggerManager?.getInstance?.();if(!Q)return;for(let q=0;q<$.length;q++){let Z=$[q],j=this._eachInstances[q];Q.registerGesture(j,{...J,target:Z,each:!1,_siblings:this._eachInstances,_index:q})}}onCursor(J){return U.triggerManager?.getInstance?.().registerCursor(this,J),this}_updateCallbackChild(J,$,Q){let q=J.startTime,Z=$<q&&this._time>=q,j=$>q&&this._time<=q,G=Math.abs(this._time-q)<0.001;if(Z||j||G&&Q===0){let z=J.child,W=J.params||[];z(...W)}}_updateAnimationChild(J,$){let Q=J.child,q=Math.abs(Q.getTimeScale())||1,Z=Q.totalDuration()/q,j=this._time-J.startTime,G=j*q;if(j>=0&&j<=Z){if(!Q.isActive())Q.captureStartValues(),Q.play();Q.renderAtTime(G)}else if(j<0){if(!Q.isLazyCapture())Q.renderAtTime(0);if(Q.isActive())Q.pause(),Q.fireReverseComplete()}else if(Q.isActive())Q.renderAtTime(Q.totalDuration()),Q.pause();else if($===0)Q.renderAtTime(Q.totalDuration())}_updateTimelineChild(J,$){let Q=J.child,q=Q.duration(),Z=this._time-J.startTime;if(Z>=0&&Z<=q){if(!Q.isActive())Q.play();Q.time(Z)}else if(Q.isActive())if(Z<0)Q.time(0),Q.pause();else Q.time(q),Q.pause();else if($===0)if(Z<0);else Q.time(q)}update(J){if(this._eachInstances){for(let q of this._eachInstances)q.update(J);return}let $=this._time;if(!this._isActive&&J===0);else if(!this._isActive)return;let Q=J*this._timeScale;if(this._inRepeatDelay&&J>0){if(this._repeatDelayCounter-=Q,this._repeatDelayCounter>0)return;if(this._inRepeatDelay=!1,this._repeatDelayCounter=0,this._isReversed){this._time=this._duration;for(let q of this._children)if(q.type==="animation")q.child.resetForReplay()}else this._time=0,this._startFired=!1,this._resetChildrenForCycle()}else if(!this._inRepeatDelay){if(this._time+=this._isReversed?-Q:Q,J>0){if(!this._isReversed&&this._time>=this._duration&&this._repeat!==0){if(this._repeat===-1||this._currentRepeat<this._repeat){this._time=this._duration,this._currentRepeat++;try{this._onRepeat?.(this._currentRepeat)}catch(Z){console.error("[Motion] onRepeat callback error:",Z)}if(this._yoyo){this._isReversed=!0;for(let Z of this._children)if(Z.type==="animation")Z.child.resetForReplay()}else this._time=0,this._startFired=!1,this._resetChildrenForCycle();if(this._repeatDelay>0)this._inRepeatDelay=!0,this._repeatDelayCounter=this._repeatDelay}}else if(this._isReversed&&this._time<=0&&this._yoyo&&this._repeat!==0){if(this._repeat===-1||this._currentRepeat<this._repeat){this._time=0,this._currentRepeat++;try{this._onRepeat?.(this._currentRepeat)}catch(Z){console.error("[Motion] onRepeat callback error:",Z)}if(this._isReversed=!1,this._startFired=!1,this._resetChildrenForCycle(),this._repeatDelay>0)this._inRepeatDelay=!0,this._repeatDelayCounter=this._repeatDelay}}}}if(this._time<0)this._time=0;else if(this._time>this._duration)this._time=this._duration;if(this._progress=this._duration>0?this._time/this._duration:0,!this._startFired&&this._isActive&&this._time>0)this._startFired=!0,this._disableTransitions(),this._applyWillChange(),this._onStart?.();if(this._isActive)this._onUpdate?.(this._progress,this._time);for(let q of this._children)if(q.type==="callback")this._updateCallbackChild(q,$,J);else if(q.type==="animation")this._updateAnimationChild(q,J);else if(q.type==="timeline")this._updateTimelineChild(q,J);if(!this._completeFired){let q=!this._isReversed&&this._time>=this._duration,Z=this._isReversed&&this._time<=0,j=this._repeat!==-1&&this._currentRepeat>=this._repeat;if(q&&(this._repeat===0||j))this._completeFired=!0,this._isActive=!1,this._startFired=!1,this._restoreTransitions(),this._onComplete?.();else if(Z&&(this._repeat===0||this._yoyo&&j))this._completeFired=!0,this._isActive=!1,this._startFired=!1,this._restoreTransitions(),this._onComplete?.()}}play(J){if(this._killed)return console.warn("[Motion] Cannot play a killed timeline. Create a new one with Motion(name)."),this;if(this._eachInstances){for(let $ of this._eachInstances)$.play(J);return this}if(J!==void 0){if(this._time=J,this._progress=this._duration>0?this._time/this._duration:0,J===0)this._currentRepeat=0,this._inRepeatDelay=!1,this._repeatDelayCounter=0}else if(this._time>=this._duration&&!this._isReversed)return this;return this._completeFired=!1,this._isReversed=!1,this._isActive=!0,this._atZeroState=!1,this}pause(J){if(this._killed)return console.warn("[Motion] Cannot pause a killed timeline. Create a new one with Motion(name)."),this;if(this._eachInstances){for(let $ of this._eachInstances)$.pause(J);return this}if(J!==void 0)this._time=J,this._progress=this._duration>0?this._time/this._duration:0;this._isActive=!1;for(let $ of this._children)if($.type!=="callback"){let Q=$.child;if("pause"in Q)Q.pause()}return this}reverse(J){if(this._killed)return console.warn("[Motion] Cannot reverse a killed timeline. Create a new one with Motion(name)."),this;if(this._eachInstances){for(let $ of this._eachInstances)$.reverse(J);return this}if(J!==void 0)this._time=J,this._progress=this._duration>0?this._time/this._duration:0;else if(this._time<=0&&this._isReversed)return this;return this._completeFired=!1,this._inRepeatDelay=!1,this._repeatDelayCounter=0,this._isReversed=!0,this._isActive=!0,this._atZeroState=!1,this}restart(){if(this._killed)return console.warn("[Motion] Cannot restart a killed timeline. Create a new one with Motion(name)."),this;if(this._eachInstances){for(let J of this._eachInstances)J.restart();return this}this._time=0,this._progress=0,this._isActive=!0,this._isReversed=!1,this._startFired=!1,this._atZeroState=!1,this._currentRepeat=0,this._completeFired=!1,this._inRepeatDelay=!1,this._repeatDelayCounter=0;for(let J of this._children)if(J.type==="animation")J.child.resetForReplay();return this._restoreInitialValues(),this._renderPositionZeroAnimations(),this}_resetChildrenForCycle(){for(let J of this._children)if(J.type==="animation")J.child.resetForReplay();this._restoreInitialValues(),this._renderPositionZeroAnimations()}_renderPositionZeroAnimations(){for(let J of this._children)if(J.type==="animation"){let $=J.child;if(!$.isLazyCapture())$.renderAtTime(0);if($.isActive())$.pause()}else if(J.type==="timeline")J.child.progress(0)}seek(J){if(this._killed)return console.warn("[Motion] Cannot seek a killed timeline. Create a new one with Motion(name)."),this;if(this._eachInstances){for(let $ of this._eachInstances)$.seek(J);return this}return this._time=Math.max(0,Math.min(J,this._duration)),this._progress=this._duration>0?this._time/this._duration:0,this._atZeroState=!1,this.update(0),this}setAxisProgress(J,$){let Q=Math.max(0,Math.min(1,$));for(let q of this._children)if(q.type==="animation"&&q.builder){if(q.builder.getConfig().axis===J){let j=q.child,G=j.totalDuration();if(!j.isActive())j.captureStartValues(),j.play();j.renderAtTime(Q*G)}}return this}onStart(J){return this._onStart=J,this}onUpdate(J){return this._onUpdate=J,this}onComplete(J){return this._onComplete=J,this}onRepeat(J){return this._onRepeat=J,this}withRepeat(J){if(typeof J==="number")this._repeat=J,this._repeatDelay=0,this._yoyo=!1;else this._repeat=J.times,this._repeatDelay=J.delay??0,this._yoyo=J.yoyo??!1;return this}progress(J){if(J===void 0){if(this._eachInstances&&this._eachInstances.length>0){let Q=0;for(let q of this._eachInstances){let Z=q.progress();if(Z>Q)Q=Z}return Q}return this._progress}if(this._eachInstances){for(let Q of this._eachInstances)Q.progress(J);return this}let $=Math.max(0,Math.min(1,J));if(!this._transitionsDisabled&&this._savedTransitions.size>0)this._disableTransitions(),this._applyWillChange();if($===0){for(let Q of this._children)if(Q.type==="animation")Q.child.resetForReplay()}if(this._time=$*this._duration,this._progress=$,$===0)if(this._atZeroState);else this._restoreInitialValues(),this._renderPositionZeroAnimations(),this._atZeroState=!0;else this._atZeroState=!1,this.update(0);return this._onUpdate?.(this._progress,this._time),this}time(J){if(J===void 0){if(this._eachInstances&&this._eachInstances.length>0){let $=0;for(let Q of this._eachInstances){let q=Q.time();if(q>$)$=q}return $}return this._time}if(this._eachInstances){for(let $ of this._eachInstances)$.time(J);return this}return this._time=Math.max(0,Math.min(J,this._duration)),this._progress=this._duration>0?this._time/this._duration:0,this.update(0),this}timeScale(J){if(J===void 0)return this._timeScale;return this._timeScale=J,this}kill(J=!0){if(this._killed=!0,this._isActive=!1,this._atZeroState=!1,U.triggerManager?.getInstance?.().unregister(this),this._eachInstances){for(let $ of this._eachInstances)$.kill(J);this._eachInstances=void 0}if(this._clearTransitionData(),J&&(this._initialValues.size>0||this._transformElements.size>0))this._restoreInitialValues();if(J&&this._splitParentOverrides.size>0){for(let[$,Q]of this._splitParentOverrides)if(Q)$.style.opacity=Q;else $.style.removeProperty("opacity");this._splitParentOverrides.clear()}for(let $ of this._children)if($.type==="animation"){let Q=$.child;Q.setTimelineChild(!1),Q.kill()}else if($.type==="timeline")$.child.kill(J);if(this._unregisterCallback)this._unregisterCallback(),this._unregisterCallback=void 0;this._children=[],this._initialValues.clear(),this._initialTransforms.clear(),this._transformElements.clear(),this._savedTransitions.clear(),this._savedWillChange.clear(),this._splitParentOverrides.clear(),this._willChangeApplied=!1,this._transitionsDisabled=!1,this._duration=0,this._time=0,this._progress=0,this._previousStart=0,this._previousEnd=0,this._isReversed=!1,this._startFired=!1,this._currentRepeat=0,this._completeFired=!1,this._inRepeatDelay=!1,this._repeatDelayCounter=0}isActive(){if(this._eachInstances)return this._eachInstances.some((J)=>J.isActive());return this._isActive}reversed(){if(this._eachInstances)return this._eachInstances.some((J)=>J.reversed());return this._isReversed}getName(){return this._name}getFirstChildAnimation(){let J=this._children[0];if(J?.type==="animation")return J.child;return null}getFirstChildBuilder(){let J=this._children[0];if(J?.type==="animation"&&J.builder)return J.builder;return null}}function S0(J,$,Q){let q=J;if(y($)){let G=Q??($.startsWith("scale")?"":"px");return(z)=>{P(J,$,z,G),q.style.transform=R(J)}}if($.startsWith("--")){let G=Q??"";return(z)=>{q.style.setProperty($,`${z}${G}`)}}let Z=$.replace(/([A-Z])/g,"-$1").toLowerCase(),j=Q??"";return(G)=>{q.style.setProperty(Z,`${G}${j}`)}}var t6=new Set(["opacity","z-index","font-weight","line-height","flex","flex-grow","flex-shrink","order","scale","column-count","columns","tab-size","orphans","widows","zoom"]);function e6(J){if(typeof location>"u")return!J.includes(":");try{let $=new URL(J,location.href);return $.protocol==="https:"||$.protocol==="http:"}catch{return!J.includes(":")}}class _0 extends f{_element=null;_innerElement=null;_mousePos={x:-100,y:-100};_cursorPos={x:-100,y:-100};_xSetter=null;_ySetter=null;_squeezeSetter=null;_squeezeConfig={min:0.55,max:1.2,multiplier:150};_state="default";_stateTimelines=new Map;_parsedStates=new Map;_textElement=null;_mediaElement=null;_tickerCallback;_boundMouseMove;_boundMouseDown;_boundMouseUp;_hoverSelectors=null;_isHoveringCursorTarget=!1;_boundHoverTargetMoveHandler=null;_cursorStyleTag=null;_attributeListeners=new Map;constructor(J,$){super(J,$);if(this._config={type:"basic",smooth:0.25,hideNative:!1,...$},$.squeeze===!0)this._squeezeConfig={min:0.55,max:1.2,multiplier:150};else if(typeof $.squeeze==="object")this._squeezeConfig={min:$.squeeze.min??0.55,max:$.squeeze.max??1.2,multiplier:$.squeeze.multiplier??150};if(this._parsedStates.set("default",this._parseStateConfig($.default)),$.hover)this._parsedStates.set("hover",this._parseStateConfig($.hover));if($.click)this._parsedStates.set("click",this._parseStateConfig($.click))}_parseStateConfig(J){let{targets:$,duration:Q,ease:q,enabled:Z,...j}=J;return{properties:j,duration:Q??0.15,ease:q??"power3.inOut",targets:$,enabled:Z??!0}}_onEnable(){if(this._element=this._createContainer(),this._innerElement=document.createElement("div"),this._innerElement.setAttribute("data-cursor-inner",""),this._innerElement.style.cssText="pointer-events:none;position:absolute;top:0;left:0;",this._element.appendChild(this._innerElement),P(this._innerElement,"x",-50,"%"),P(this._innerElement,"y",-50,"%"),this._xSetter=S0(this._element,"x","px"),this._ySetter=S0(this._element,"y","px"),this._config.squeeze)this._squeezeSetter=S0(this._element,"scale");if(this._cursorPos={x:-100,y:-100},this._mousePos={x:-100,y:-100},this._xSetter(-100),this._ySetter(-100),this._applyProperties(this._parsedStates.get("default").properties),this._innerElement.style.transform=R(this._innerElement),this._config.hideNative)this._cursorStyleTag=document.createElement("style"),this._cursorStyleTag.setAttribute("data-cursor-hide",""),this._cursorStyleTag.textContent="* { cursor: none !important; }",document.head.appendChild(this._cursorStyleTag);if(this._config.type==="text")this._setupTextCursor();else if(this._config.type==="media")this._setupMediaCursor();this._createStateTimelines(),this._setupEventListeners(),this._tickerCallback=(J)=>this._tick(J),V.getInstance().add(this._tickerCallback)}_onDisable(){if(this._tickerCallback)V.getInstance().remove(this._tickerCallback),this._tickerCallback=void 0;if(this._cursorStyleTag)this._cursorStyleTag.remove(),this._cursorStyleTag=null;if(this._removeEventListeners(),this._stateTimelines.forEach((J)=>J.kill()),this._stateTimelines.clear(),this._innerElement?.parentNode)this._innerElement.remove();if(this._innerElement=null,this._element?.parentNode)this._element.remove();this._element=null}_createContainer(){let J=document.createElement("div");return J.setAttribute("data-cursor-container",""),J.style.cssText="position:fixed;top:0;left:0;pointer-events:none;z-index:999999;width:0;height:0;",document.body.appendChild(J),J}_applyProperties(J){if(!this._innerElement)return;for(let[$,Q]of Object.entries(J))if($==="transform"){let q=_0._expandTransformShorthand(String(Q));for(let[Z,j]of Object.entries(q))P(this._innerElement,Z,j)}else if(y($)){let q=typeof Q==="number"?{value:Q,unit:t($)}:c(Q);P(this._innerElement,$,q.value,q.unit||t($)||void 0)}else{let q=o($),Z=typeof Q==="number"&&!t6.has(q)?`${Q}px`:String(Q);this._innerElement.style.setProperty(q,Z)}}_createStateTimelines(){if(!this._innerElement)return;let J=this._parsedStates.get("hover");if(J&&J.enabled){let Q=new b;Q._addEntry(this._innerElement,{to:_0._expandStateProperties(J.properties),duration:J.duration,ease:J.ease}),this._stateTimelines.set("hover",Q)}let $=this._parsedStates.get("click");if($&&$.enabled){let Q=new b;Q._addEntry(this._innerElement,{to:_0._expandStateProperties($.properties),duration:$.duration,ease:$.ease}),this._stateTimelines.set("click",Q)}}static _expandStateProperties(J){let $={};for(let[Q,q]of Object.entries(J))if(Q==="transform"){let Z=_0._expandTransformShorthand(String(q));Object.assign($,Z)}else $[Q]=q;return $}static _expandTransformShorthand(J){let $={},Q=/([a-zA-Z0-9]+)\(([^)]+)\)/g,q;while((q=Q.exec(J))!==null){let Z=q[1],j=q[2].split(",").map((G)=>parseFloat(G.trim()));switch(Z){case"scale":{let G=j[0]??1,z=j.length>1?j[1]:G;if(G===z)$.scale=G;else $.scaleX=G,$.scaleY=z;break}case"scaleX":$.scaleX=j[0]??1;break;case"scaleY":$.scaleY=j[0]??1;break;case"scaleZ":$.scaleZ=j[0]??1;break;case"rotate":$.rotate=j[0]??0;break;case"rotateX":$.rotateX=j[0]??0;break;case"rotateY":$.rotateY=j[0]??0;break;case"rotateZ":$.rotateZ=j[0]??0;break;case"skewX":$.skewX=j[0]??0;break;case"skewY":$.skewY=j[0]??0;break}}return $}_setupEventListeners(){if(this._boundMouseMove=(Q)=>{this._mousePos.x=Q.clientX,this._mousePos.y=Q.clientY},document.addEventListener("mousemove",this._boundMouseMove),this._parsedStates.get("click")?.enabled)this._boundMouseDown=()=>this._setState("click"),this._boundMouseUp=()=>this._setState(this._state==="click"?"default":this._state),document.addEventListener("mousedown",this._boundMouseDown),document.addEventListener("mouseup",this._boundMouseUp);let $=this._parsedStates.get("hover");if($?.enabled&&$.targets&&$.targets.length>0)this._setupHoverTargets($.targets)}_setupHoverTargets(J){this._hoverSelectors=J,this._boundHoverTargetMoveHandler=($)=>{let q=document.elementsFromPoint($.clientX,$.clientY).some((Z)=>this._hoverSelectors.some((j)=>{try{return Z.matches(j)}catch{return!1}}));if(q&&!this._isHoveringCursorTarget)this._isHoveringCursorTarget=!0,this._setState("hover");else if(!q&&this._isHoveringCursorTarget){if(this._isHoveringCursorTarget=!1,this._state==="hover")this._setState("default")}},window.addEventListener("mousemove",this._boundHoverTargetMoveHandler)}_setupTextCursor(){if(!this._innerElement)return;this._innerElement.style.display="grid",this._innerElement.style.placeItems="center",this._innerElement.style.overflow="visible",this._textElement=document.createElement("div"),this._textElement.setAttribute("data-cursor-text",""),this._textElement.style.whiteSpace="nowrap",this._textElement.style.opacity="0",this._innerElement.appendChild(this._textElement);let $=this._parsedStates.get("hover")?.duration??0.15;if(this._textElement.style.transition=`opacity ${$}s ease-in-out`,this._config.text)for(let[q,Z]of Object.entries(this._config.text))this._textElement.style.setProperty(o(q),String(Z));let Q=document.querySelectorAll("[mp-cursor-text], [mp-cursor-tooltip]");for(let q of Q){let Z=(G)=>{let z=G.target,W=z.getAttribute("mp-cursor-text")??z.getAttribute("mp-cursor-tooltip")??"";if(this._textElement)this._textElement.textContent=W,this._textElement.style.opacity="1";this._setState("hover")},j=()=>{if(this._textElement)this._textElement.style.opacity="0";if(this._state==="hover")this._setState("default")};q.addEventListener("mouseenter",Z),q.addEventListener("mouseleave",j),this._attributeListeners.set(q,{enter:Z,leave:j})}}_setupMediaCursor(){if(!this._innerElement)return;let J=document.createElement("img");J.setAttribute("data-cursor-media",""),J.style.display="none",this._innerElement.appendChild(J);let $=document.createElement("video");if($.setAttribute("data-cursor-media",""),$.autoplay=!0,$.muted=!0,$.loop=!0,$.style.display="none",this._innerElement.appendChild($),this._config.media)for(let[q,Z]of Object.entries(this._config.media))J.style.setProperty(o(q),String(Z)),$.style.setProperty(o(q),String(Z));let Q=document.querySelectorAll("[mp-cursor-media]");for(let q of Q){let Z=(G)=>{let z=G.target.getAttribute("mp-cursor-media")||"";if(!z||!e6(z)){if(z)console.warn(`[Motion] Blocked unsafe media URL: "${z}". Only http/https URLs and relative paths are allowed.`);return}if(z.endsWith(".mp4")||z.endsWith(".webm"))$.src=z,$.style.display="block",J.style.display="none",$.play().catch(()=>{}),this._mediaElement=$;else J.src=z,J.style.display="block",$.style.display="none",this._mediaElement=J;this._setState("hover")},j=()=>{if(J.style.display="none",$.style.display="none",$.pause(),this._state==="hover")this._setState("default")};q.addEventListener("mouseenter",Z),q.addEventListener("mouseleave",j),this._attributeListeners.set(q,{enter:Z,leave:j})}}_removeEventListeners(){if(this._boundMouseMove)document.removeEventListener("mousemove",this._boundMouseMove);if(this._boundMouseDown)document.removeEventListener("mousedown",this._boundMouseDown);if(this._boundMouseUp)document.removeEventListener("mouseup",this._boundMouseUp);if(this._boundHoverTargetMoveHandler)window.removeEventListener("mousemove",this._boundHoverTargetMoveHandler),this._boundHoverTargetMoveHandler=null;this._hoverSelectors=null,this._isHoveringCursorTarget=!1,this._attributeListeners.forEach((J,$)=>{$.removeEventListener("mouseenter",J.enter),$.removeEventListener("mouseleave",J.leave)}),this._attributeListeners.clear()}_setState(J){if(this._state===J)return;let $=this._state;this._state=J;let Q=this._stateTimelines.get(J),q=this._stateTimelines.get($);if(J==="default"){if(q)q.reverse()}else{if($!=="default"&&q)q.reverse();if(Q)Q.play()}}_tick(J){if(!this._xSetter||!this._ySetter)return;let $=this._config.smooth??0.25,Q=Math.pow($,2.5)||0.000001,q=1-Math.pow(1-Q,J*60);if(this._cursorPos.x+=(this._mousePos.x-this._cursorPos.x)*q,this._cursorPos.y+=(this._mousePos.y-this._cursorPos.y)*q,this._xSetter(this._cursorPos.x),this._ySetter(this._cursorPos.y),this._squeezeSetter&&this._config.squeeze){let Z=this._calculateSqueeze();this._squeezeSetter(Z)}for(let Z of this._stateTimelines.values())if(Z.isActive())Z.update(J)}_calculateSqueeze(){let J=this._cursorPos.x-this._mousePos.x,$=this._cursorPos.y-this._mousePos.y,Q=Math.sqrt(J*J+$*$),{min:q,max:Z,multiplier:j}=this._squeezeConfig,G=1-(Math.exp(Q/j)-1)/10;if(Number.isNaN(G))return 1;return Math.max(q,Math.min(Z,G))}getElement(){return this._element}getState(){return this._state}}I.registerTrigger("cursor",_0);class lJ extends f{_links=[];_listeners=new Map;_isNavigating=!1;_pendingUrl=null;_onCompleteHandler=null;_pollTimerId=null;constructor(J,$){super(J,$)}_onEnable(){if(this._isInsideBuilder())return;this._resolveLinks(),this._addClickListeners()}_onDisable(){if(this._cleanupListenerMap(this._listeners),this._links=[],this._isNavigating=!1,this._pendingUrl=null,this._pollTimerId!==null)clearTimeout(this._pollTimerId),this._pollTimerId=null;if(this._onCompleteHandler)this._onCompleteHandler=null}_isInsideBuilder(){try{if(typeof window<"u"&&window.top?.mp_iframe)return!0}catch{}return!1}_resolveLinks(){if(typeof document>"u")return;let J=this._config.mode||"all",$;if(J==="include"&&this._config.selectors&&this._config.selectors.trim()!=="")try{$=Array.from(document.querySelectorAll(this._config.selectors)).filter((q)=>q.tagName==="A"),document.querySelectorAll(this._config.selectors).forEach((q)=>{if(q.tagName!=="A"){let Z=q.querySelectorAll("a");$.push(...Array.from(Z))}})}catch(Q){console.warn(`[Motion] Invalid selector "${this._config.selectors}":`,Q),$=[]}else if(J==="include")$=[];else if(J==="exclude"&&this._config.selectors&&this._config.selectors.trim()!==""){let Q=Array.from(document.querySelectorAll("a")),q;try{q=new Set(document.querySelectorAll(this._config.selectors))}catch(Z){console.warn(`[Motion] Invalid selector "${this._config.selectors}":`,Z),q=new Set}$=Q.filter((Z)=>!q.has(Z))}else $=Array.from(document.querySelectorAll("a"));this._links=[...new Set($)],this._links=this._links.filter((Q)=>this._shouldIntercept(Q))}_shouldIntercept(J){let $=J.getAttribute("href");if(!$||$==="")return!1;let Q=this._config.skipHref||[];if($.startsWith("#"))return!Q.includes("anchor");if($.toLowerCase().startsWith("javascript:"))return!Q.includes("javascript");if($.toLowerCase().startsWith("mailto:")||$.toLowerCase().startsWith("tel:"))return!Q.includes("mailto");return!0}_addClickListeners(){this._links.forEach((J)=>{let $=new Map,Q=(q)=>{if(this._isNavigating)return;let Z=q;if(Z.ctrlKey||Z.metaKey||Z.shiftKey||Z.altKey)return;let j=J.getAttribute("target");if(j&&j!=="_self")return;let G=J.href;if(!G)return;q.preventDefault(),q.stopPropagation(),this._isNavigating=!0,this._pendingUrl=G,this._onCompleteHandler=()=>{this._navigate()},this._timeline.restart(),this._waitForCompletion()};J.addEventListener("click",Q),$.set("click",Q),this._listeners.set(J,$)})}_waitForCompletion(){let J=this._timeline,$=16,Q=()=>{if(this._pollTimerId=null,!this._enabled||!this._isNavigating||!this._pendingUrl)return;let q=J.progress(),Z=J.isActive();if(q>=1||!Z&&q>0)this._navigate();else this._pollTimerId=setTimeout(Q,16)};this._pollTimerId=setTimeout(Q,16)}_navigate(){if(!this._pendingUrl)return;let J=this._pendingUrl;if(this._pendingUrl=null,this._isNavigating=!1,typeof window<"u")window.location.href=J}}I.registerTrigger("pageExit",lJ);var YJ=null;function J7(){if(!YJ&&typeof document<"u"){let J=document.createElement("canvas");J.width=1,J.height=1,YJ=J.getContext("2d")}return YJ}function oJ(J){let $=J.replace("#",""),Q,q,Z,j=1;if($.length===3)Q=parseInt($[0]+$[0],16),q=parseInt($[1]+$[1],16),Z=parseInt($[2]+$[2],16);else if($.length===4)Q=parseInt($[0]+$[0],16),q=parseInt($[1]+$[1],16),Z=parseInt($[2]+$[2],16),j=parseInt($[3]+$[3],16)/255;else if($.length===6)Q=parseInt($.slice(0,2),16),q=parseInt($.slice(2,4),16),Z=parseInt($.slice(4,6),16);else if($.length===8)Q=parseInt($.slice(0,2),16),q=parseInt($.slice(2,4),16),Z=parseInt($.slice(4,6),16),j=parseInt($.slice(6,8),16)/255;else return null;if(isNaN(Q)||isNaN(q)||isNaN(Z)||isNaN(j))return null;return new Float32Array([Q,q,Z,j])}function $7(J){let $=J.match(/rgba?\s*\(\s*([\d.]+)\s*[,\s]\s*([\d.]+)\s*[,\s]\s*([\d.]+)\s*(?:[,\/]\s*([\d.]+))?\s*\)/i);if(!$)return null;let Q=parseFloat($[1]),q=parseFloat($[2]),Z=parseFloat($[3]),j=$[4]!==void 0?parseFloat($[4]):1;if(isNaN(Q)||isNaN(q)||isNaN(Z)||isNaN(j))return null;return new Float32Array([Q,q,Z,j])}function Q7(J,$,Q){J=J/360,$=$/100,Q=Q/100;let q,Z,j;if($===0)q=Z=j=Q;else{let G=(B,N,_)=>{if(_<0)_+=1;if(_>1)_-=1;if(_<0.16666666666666666)return B+(N-B)*6*_;if(_<0.5)return N;if(_<0.6666666666666666)return B+(N-B)*(0.6666666666666666-_)*6;return B},z=Q<0.5?Q*(1+$):Q+$-Q*$,W=2*Q-z;q=G(W,z,J+0.3333333333333333),Z=G(W,z,J),j=G(W,z,J-0.3333333333333333)}return[Math.round(q*255),Math.round(Z*255),Math.round(j*255)]}function q7(J){let $=J.match(/hsla?\s*\(\s*([\d.]+)\s*[,\s]\s*([\d.]+)%\s*[,\s]\s*([\d.]+)%\s*(?:[,\/]\s*([\d.]+))?\s*\)/i);if(!$)return null;let Q=parseFloat($[1]),q=parseFloat($[2]),Z=parseFloat($[3]),j=$[4]!==void 0?parseFloat($[4]):1;if(isNaN(Q)||isNaN(q)||isNaN(Z)||isNaN(j))return null;let[G,z,W]=Q7(Q,q,Z);return new Float32Array([G,z,W,j])}function Z7(J,$){if(!$||typeof window>"u")return null;let Q=J.match(/var\s*\(\s*(--[\w-]+)\s*\)/i);if(!Q)return null;let q=Q[1],Z=window.getComputedStyle($).getPropertyValue(q).trim();if(!Z)return null;return XJ(Z,$)}function j7(J){let $=J7();if(!$)return null;$.fillStyle="#000000",$.fillStyle=J;let Q=$.fillStyle;if(Q==="#000000"&&J.toLowerCase()!=="black"&&J!=="#000000"&&J!=="#000")return null;return oJ(Q)}function XJ(J,$){if(!J||typeof J!=="string")return null;let Q=J.trim().toLowerCase();if(Q==="transparent")return new Float32Array([0,0,0,0]);if(Q.startsWith("#"))return oJ(Q);if(Q.startsWith("rgb"))return $7(Q);if(Q.startsWith("hsl"))return q7(Q);if(Q.startsWith("var("))return Z7(Q,$);return j7(Q)}function G7(J,$){if(typeof window>"u")return new Float32Array([0,0,0,1]);let Q=window.getComputedStyle(J),q=$.replace(/[A-Z]/g,(G)=>`-${G.toLowerCase()}`),Z=Q.getPropertyValue(q).trim();if(!Z||Z==="none")J.offsetHeight,Z=window.getComputedStyle(J).getPropertyValue(q).trim();if(!Z||Z==="none")return new Float32Array([0,0,0,0]);return XJ(Z,J)||new Float32Array([0,0,0,1])}U.color={parseColor:XJ,getCurrentColor:G7};var iJ={blur:{value:0,unit:"px"},brightness:{value:1,unit:""},contrast:{value:1,unit:""},saturate:{value:1,unit:""},grayscale:{value:0,unit:""},sepia:{value:0,unit:""},"hue-rotate":{value:0,unit:"deg"},invert:{value:0,unit:""},opacity:{value:1,unit:""}};function z7(J){let $=J.trim().match(/^([\w-]+)\(\s*([\d.]+)(px|%|deg)?\s*\)$/);if(!$)return null;let Q=$[1].toLowerCase(),q=parseFloat($[2]),Z=$[3]||"";if(Z==="%")q=q/100,Z="";return{name:Q,value:q,unit:Z}}function nJ(J){if(J===null||J===void 0||typeof J!=="string")return null;let $=J.trim().toLowerCase();if($==="none"||$==="")return[];let Q=[],q=/([\w-]+)\([^)]+\)/g,Z;while((Z=q.exec($))!==null){let j=z7(Z[0]);if(j)Q.push(j)}return Q.length>0?Q:null}function W7(J){let $=iJ[J.name];if(!$)return!1;return J.value===$.value}function N7(J){if(!J||J.length===0)return"none";if(J.every(W7))return"none";return J.map(($)=>{let Q;if($.name==="blur")Q=`${$.value}${$.unit||"px"}`;else if($.name==="hue-rotate")Q=`${$.value}${$.unit||"deg"}`;else Q=`${$.value}`;return`${$.name}(${Q})`}).join(" ")}function B7(J){if(typeof window>"u")return[];let $=window.getComputedStyle(J),Q=$.filter||$.getPropertyValue("filter");if(!Q||Q==="none")return[];return nJ(Q)||[]}function _7(J){let $=iJ[J];if($)return{name:J,value:$.value,unit:$.unit};return{name:J,value:0,unit:""}}function H7(J,$){let Q=new Set;for(let j of J)Q.add(j.name);for(let j of $)Q.add(j.name);let q=[],Z=[];for(let j of Q){let G=J.find((B)=>B.name===j),z=$.find((B)=>B.name===j),W=_7(j);q.push(G||W),Z.push(z||W)}return{start:q,end:Z}}var H0=[];function Y7(J,$,Q){let q=J.length;if(H0.length<q)for(let Z=H0.length;Z<q;Z++)H0.push({name:"",value:0,unit:""});for(let Z=0;Z<q;Z++){let j=J[Z],G=$[Z],z=H0[Z];z.name=j.name,z.value=j.value+(G.value-j.value)*Q,z.unit=j.unit||G.unit}return H0.length=q,H0}U.filter={parseFilter:nJ,getCurrentFilter:B7,mergeFilterArrays:H7,interpolateFilters:Y7,filterToString:N7};var aJ=new WeakMap;function X7(J){return"getTotalLength"in J&&typeof J.getTotalLength==="function"}function y0(J){let $=aJ.get(J);if($!==void 0)return $;if(X7(J)){let Q=J.getTotalLength();return aJ.set(J,Q),Q}return 0}function K7(J,$){if(J===null||J===void 0)return null;if(typeof J==="object"){let Q=J.start??0,q=J.end??100;return{start:Q/100,end:q/100}}if(typeof J==="string"){let Q=J.trim();if(Q==="true")return{start:0,end:1};if(Q==="false"||Q===""||Q==="none")return{start:0,end:0};let q=Q.match(/^([-\d.]+)(px|%)?\s+([-\d.]+)(px|%)?$/);if(q){let j=parseFloat(q[1]),G=q[2]||"%",z=parseFloat(q[3]),W=q[4]||"%",B=$?y0($):0,N=KJ(j,G,B),_=KJ(z,W,B);return{start:N,end:_}}let Z=Q.match(/^([-\d.]+)(px|%)?$/);if(Z){let j=parseFloat(Z[1]),G=Z[2]||"%",z=$?y0($):0;return{start:0,end:KJ(j,G,z)}}}return null}function KJ(J,$,Q){if($==="px"&&Q>0)return J/Q;return J/100}function U7(J){let $=y0(J);if($===0)return{start:0,end:1};try{if(typeof window<"u"&&window.getComputedStyle){let Q=window.getComputedStyle(J),q=Q.strokeDasharray,Z=Q.strokeDashoffset;if(!q||q==="none")return{start:0,end:1};let j=q.split(/[\s,]+/).map(parseFloat).filter((z)=>!isNaN(z)),G=parseFloat(Z)||0;if(j.length>=1){let z=j[0],W=-G/$,B=(-G+z)/$;return{start:W,end:B}}}}catch{}return{start:0,end:1}}function F7(J,$,Q,q){if(!(J instanceof SVGElement)||q===0)return;let Z=J,j=Math.abs(Q-$)*q,G=Math.min($,Q)*q;Z.style.strokeDasharray=`${j} ${q}`,Z.style.strokeDashoffset=`${-G}`}U.drawSVG={parseDrawSVG:K7,getCurrentDrawSVG:U7,getPathLength:y0,applyDrawSVG:F7};var v0=new WeakMap,h0=new WeakMap;class T0{static split(J,$,Q){if(!(J instanceof HTMLElement))return[];let q=v0.get(J);if(q!==void 0)J.innerHTML=q,J.removeAttribute("data-split"),h0.delete(J);else v0.set(J,J.innerHTML);let Z={chars:[],words:[],lines:[],elements:[]},j=$.split(",").map((B)=>B.trim()),G=j.includes("chars"),z=j.includes("words"),W=j.includes("lines");if(W)this._splitWithLinesDom(J,z,G,Z);else if(z&&G)this._splitWordsWithCharsDom(J,Z);else if(z)this._splitWordsDom(J,Z);else if(G)this._splitCharsDom(J,Z);if(G)Z.elements=Z.chars;else if(z)Z.elements=Z.words;else if(W)Z.elements=Z.lines;if(Q?.mask&&Z.elements.length>0)this._applyMaskWrappers(Z);return this._propagateGradientText(J,Z),h0.set(J,Z),J.setAttribute("data-split",$),Z.elements}static _splitWordsDom(J,$){let Q=Array.from(J.childNodes);for(let q of Q)if(q.nodeType===3){let Z=q.textContent||"";if(!Z)continue;let j=Z.split(/(\s+)/),G=document.createDocumentFragment(),z=!1;for(let W of j)if(/^\s+$/.test(W))G.appendChild(document.createTextNode(W.replace(/\n/g," "))),z=!0;else if(W){let B=document.createElement("span");B.setAttribute("data-split-word",""),B.setAttribute("data-word-index",String($.words.length)),B.style.display="inline-block",B.textContent=W,$.words.push(B),G.appendChild(B),z=!0}if(z)J.replaceChild(G,q)}else if(q.nodeType===1){let Z=q;if(Z.tagName==="BR")continue;this._splitWordsDom(Z,$)}}static _splitCharsDom(J,$){let Q=Array.from(J.childNodes);for(let q of Q)if(q.nodeType===3){let Z=q.textContent||"";if(!Z)continue;let j=Z.split(/(\s+)/),G=document.createDocumentFragment();for(let z of j)if(/^\s+$/.test(z))G.appendChild(document.createTextNode(z.replace(/\n/g," ")));else if(z){let W=document.createElement("span");W.setAttribute("data-split-word-wrap",""),W.style.display="inline-block",W.style.whiteSpace="nowrap";for(let B of z){let N=document.createElement("span");N.setAttribute("data-split-char",""),N.setAttribute("data-char-index",String($.chars.length)),N.style.display="inline-block",N.textContent=B,$.chars.push(N),W.appendChild(N)}G.appendChild(W)}J.replaceChild(G,q)}else if(q.nodeType===1){let Z=q;if(Z.tagName==="BR")continue;this._splitCharsDom(Z,$)}}static _splitWordsWithCharsDom(J,$){let Q=Array.from(J.childNodes);for(let q of Q)if(q.nodeType===3){let Z=q.textContent||"";if(!Z)continue;let j=Z.split(/(\s+)/),G=document.createDocumentFragment();for(let z of j)if(/^\s+$/.test(z))G.appendChild(document.createTextNode(z.replace(/\n/g," ")));else if(z){let W=document.createElement("span");W.setAttribute("data-split-word",""),W.setAttribute("data-word-index",String($.words.length)),W.style.display="inline-block",W.style.whiteSpace="nowrap";for(let B of z){let N=document.createElement("span");N.setAttribute("data-split-char",""),N.setAttribute("data-char-index",String($.chars.length)),N.style.display="inline-block",N.textContent=B,$.chars.push(N),W.appendChild(N)}$.words.push(W),G.appendChild(W)}J.replaceChild(G,q)}else if(q.nodeType===1){let Z=q;if(Z.tagName==="BR")continue;this._splitWordsWithCharsDom(Z,$)}}static _splitWithLinesDom(J,$,Q,q){let Z={chars:[],words:[],lines:[],elements:[]};this._splitWordsDom(J,Z);let j=[],G=[],z=-1/0;for(let H of Z.words){let Y=H.getBoundingClientRect();if(Y.top>z+2){if(G.length>0)j.push(G);G=[H],z=Y.top}else G.push(H)}if(G.length>0)j.push(G);let W=new Map;for(let H of Z.words)W.set(H,this._getWrapperChain(H,J));let B="",N=0,_=0,X=0;for(let H of j){let Y="",F=[];for(let K=0;K<H.length;K++){let L=H[K],k=L.textContent||"",M=W.get(L)||[],O=0;while(O<F.length&&O<M.length&&F[O]===M[O])O++;for(let T=F.length-1;T>=O;T--)Y+=`</${F[T].tagName.toLowerCase()}>`;if(K>0)Y+=" ";for(let T=O;T<M.length;T++)Y+=this._openTag(M[T]);if(Q){let T="";for(let l0 of k)T+=`<span data-split-char data-char-index="${X}" style="display:inline-block">${this._escapeHtml(l0)}</span>`,X++;if($)Y+=`<span data-split-word data-word-index="${_}" style="display:inline-block;white-space:nowrap">${T}</span>`;else Y+=T}else if($)Y+=`<span data-split-word data-word-index="${_}" style="display:inline-block">${this._escapeHtml(k)}</span>`;else Y+=this._escapeHtml(k);_++,F=M}for(let K=F.length-1;K>=0;K--)Y+=`</${F[K].tagName.toLowerCase()}>`;B+=`<span data-split-line data-line-index="${N}" style="display:block">${Y}</span>`,N++}if(J.innerHTML=B,Q)q.chars=Array.from(J.querySelectorAll("[data-split-char]"));if($)q.words=Array.from(J.querySelectorAll("[data-split-word]"));q.lines=Array.from(J.querySelectorAll("[data-split-line]"))}static _applyMaskWrappers(J){let $=J.elements;for(let Q of $){let q=Q.hasAttribute("data-split-line"),Z=Q.hasAttribute("data-split-word"),j=document.createElement("span");if(j.setAttribute("data-split-mask",""),j.style.overflow="hidden",j.style.display=q?"block":"inline-block",!q)j.style.verticalAlign=Z?"bottom":"bottom";Q.parentNode.insertBefore(j,Q),j.appendChild(Q)}}static _propagateGradientText(J,$){let Q=window.getComputedStyle(J);if((Q.getPropertyValue("background-clip")||Q.getPropertyValue("-webkit-background-clip"))!=="text")return;let Z=J.querySelectorAll("[data-split-mask], [data-split-word], [data-split-word-wrap], [data-split-char], [data-split-line]");for(let j of Z)j.style.background="inherit",j.style.backgroundClip="text",j.style.setProperty("-webkit-background-clip","text"),j.style.setProperty("-webkit-text-fill-color","transparent")}static revert(J){let $=v0.get(J);if($!==void 0&&J instanceof HTMLElement)return J.innerHTML=$,J.removeAttribute("data-split"),v0.delete(J),h0.delete(J),!0;return!1}static isSplit(J){return J.hasAttribute("data-split")}static getResult(J){return h0.get(J)}static _getWrapperChain(J,$){let Q=[],q=J.parentElement;while(q&&q!==$)Q.unshift(q),q=q.parentElement;return Q}static _openTag(J){let $=J.tagName.toLowerCase(),Q="";for(let q of Array.from(J.attributes))Q+=` ${q.name}="${this._escapeHtml(q.value)}"`;return`<${$}${Q}>`}static _escapeHtml(J){return J.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}}U.textSplitter={split:(J,$,Q)=>T0.split(J,$,Q),revert:T0.revert,isSplit:T0.isSplit};class rJ{static resolve(J,$){if(J.length===0)return[];if(J.length===1)return[0];if(typeof $==="number")return J.map((Q,q)=>q*$);return this.resolveComplexStagger(J,$)}static resolveComplexStagger(J,$){let Q=J.length;if(Q===1)return[0];let q;if($.each!==void 0)q=$.each;else if($.amount!==void 0)q=$.amount/(Q-1);else q=0.1;let Z=this.getOrdering(J,$),j=Array(Q);for(let G=0;G<Q;G++)j[Z[G].originalIndex]=Z[G].order*q;return j}static getOrdering(J,$){let Q=J.length,q=$.from??"start";if($.grid)return this.getGridOrdering(J,$);switch(q){case"start":return J.map((Z,j)=>({originalIndex:j,order:j}));case"end":return J.map((Z,j)=>({originalIndex:j,order:Q-1-j}));case"center":{let Z=Math.floor(Q/2);return J.map((j,G)=>{let z=Math.abs(G-Z);return{originalIndex:G,order:z}})}case"edges":return J.map((Z,j)=>{let G=Math.min(j,Q-1-j);return{originalIndex:j,order:G}});case"random":{let Z=J.map((j,G)=>({originalIndex:G,order:Math.random()}));return Z.sort((j,G)=>j.order-G.order),Z.forEach((j,G)=>{j.order=G}),Z}default:if(typeof q==="number"){let Z=Math.max(0,Math.min(Q-1,q));return J.map((j,G)=>{let z=Math.abs(G-Z);return{originalIndex:G,order:z}})}return J.map((Z,j)=>({originalIndex:j,order:j}))}}static getGridOrdering(J,$){let Q,q;if($.grid==="auto"){let z=this.detectGrid(J);Q=z.cols,q=z.rows}else[Q,q]=$.grid;let Z=$.from??"start",j=$.axis??"x",G=J.map((z,W)=>{let B=W%Q,N=Math.floor(W/Q);return{originalIndex:W,col:B,row:N}});if(Z==="random"){let z=G.map((W)=>({originalIndex:W.originalIndex,order:Math.random()}));return z.sort((W,B)=>W.order-B.order),z.forEach((W,B)=>{W.order=B}),z}return G.map((z)=>{let W;if(typeof Z==="number"){let B=Z%Q,N=Math.floor(Z/Q);W=j==="x"?Math.abs(z.col-B)+Math.abs(z.row-N)*0.5:Math.abs(z.row-N)+Math.abs(z.col-B)*0.5}else if(Z==="center"){let B=(Q-1)/2,N=(q-1)/2;W=Math.abs(z.col-B)+Math.abs(z.row-N)}else if(Z==="edges"){let B=Math.min(z.col,Q-1-z.col),N=Math.min(z.row,q-1-z.row);W=Math.min(B,N)}else if(Z==="end")W=j==="x"?(q-1-z.row)*Q+(Q-1-z.col):(Q-1-z.col)*q+(q-1-z.row);else W=j==="x"?z.row*Q+z.col:z.col*q+z.row;return{originalIndex:z.originalIndex,order:W}})}static detectGrid(J){if(J.length===0)return{cols:0,rows:0};let $=J.filter((j)=>j instanceof Element);if($.length===0)return{cols:J.length,rows:1};let Q=new Map;$.forEach((j)=>{let G=j.getBoundingClientRect(),z=Math.round(G.top);Q.set(z,(Q.get(z)||0)+1)});let q=Q.size;return{cols:Math.ceil(J.length/q),rows:q}}}U.stagger={resolve:(J,$)=>rJ.resolve(J,$)};function A7(J,$,Q){if(!(J instanceof HTMLElement))return console.warn("[Motion Fit] Fit animations only support HTML elements. SVG elements are not supported."),null;let q=document.querySelector($);if(!q)return console.warn(`[Motion Fit] Target element not found: "${$}". Animation skipped.`),null;if(!(q instanceof HTMLElement))return console.warn("[Motion Fit] Fit animations only support HTML elements. SVG elements are not supported."),null;if(q===J)return console.warn("[Motion Fit] Target element is the same as source element. Animation skipped."),null;let Z=J.getBoundingClientRect(),j=q.getBoundingClientRect(),G=Z.width===0?1:Z.width,z=Z.height===0?1:Z.height,W=Z.left+G/2,B=Z.top+z/2,N=j.left+j.width/2,_=j.top+j.height/2,X=N-W,H=_-B,Y=j.width/G,F=j.height/z;if(!Q)return{dx:X,dy:H,sx:Y,sy:F,sourceWidth:Z.width,sourceHeight:Z.height,targetWidth:j.width,targetHeight:j.height};let K=J.offsetParent??document.documentElement,L=K.getBoundingClientRect(),k=K.scrollLeft??0,M=K.scrollTop??0;return{dx:X,dy:H,sx:Y,sy:F,sourceWidth:Z.width,sourceHeight:Z.height,targetWidth:j.width,targetHeight:j.height,sourceLeft:J.offsetLeft,sourceTop:J.offsetTop,targetLeft:j.left-L.left+k,targetTop:j.top-L.top+M}}var h=0.01,Y0=0.001;function I7(J,$,Q,q){let{absolute:Z=!1,scale:j=!0,resize:G=!1}=Q;if($ instanceof HTMLElement)S($,!1);let z=A7($,Q.target,Z);if(!z)return;if(!Z)if(G){let W=z.dx-(z.targetWidth-z.sourceWidth)/2,B=z.dy-(z.targetHeight-z.sourceHeight)/2;if(Math.abs(W)>h){let N=q.acquire();N.init($,"x",0,W,"px"),J.addPropTween(N)}if(Math.abs(B)>h){let N=q.acquire();N.init($,"y",0,B,"px"),J.addPropTween(N)}if(Math.abs(z.targetWidth-z.sourceWidth)>h){let N=q.acquire();N.init($,"width",z.sourceWidth,z.targetWidth,"px"),J.addPropTween(N)}if(Math.abs(z.targetHeight-z.sourceHeight)>h){let N=q.acquire();N.init($,"height",z.sourceHeight,z.targetHeight,"px"),J.addPropTween(N)}}else{let W=n($,"x"),B=n($,"y"),N=W+z.dx,_=B+z.dy;if(Math.abs(N-W)>h||Math.abs(W)>h||Math.abs(N)>h){let X=q.acquire();X.init($,"x",W,N,"px"),J.addPropTween(X)}if(Math.abs(_-B)>h||Math.abs(B)>h||Math.abs(_)>h){let X=q.acquire();X.init($,"y",B,_,"px"),J.addPropTween(X)}if(j){let X=n($,"scaleX"),H=n($,"scaleY"),Y=X*z.sx,F=H*z.sy;if(Math.abs(Y-X)>Y0||Math.abs(X-1)>Y0||Math.abs(Y-1)>Y0){let K=q.acquire();K.init($,"scaleX",X,Y,""),J.addPropTween(K)}if(Math.abs(F-H)>Y0||Math.abs(H-1)>Y0||Math.abs(F-1)>Y0){let K=q.acquire();K.init($,"scaleY",H,F,""),J.addPropTween(K)}}}else{let W=$;if(window.getComputedStyle(W).position==="static")W.style.position="absolute";let{sourceLeft:N,sourceTop:_,targetLeft:X,targetTop:H}=z;if(Math.abs(X-N)>h){let Y=q.acquire();Y.init($,"left",N,X,"px"),J.addPropTween(Y)}if(Math.abs(H-_)>h){let Y=q.acquire();Y.init($,"top",_,H,"px"),J.addPropTween(Y)}if(j){if(Math.abs(z.targetWidth-z.sourceWidth)>h){let Y=q.acquire();Y.init($,"width",z.sourceWidth,z.targetWidth,"px"),J.addPropTween(Y)}if(Math.abs(z.targetHeight-z.sourceHeight)>h){let Y=q.acquire();Y.init($,"height",z.sourceHeight,z.targetHeight,"px"),J.addPropTween(Y)}}}}function O7(J,$,Q,q){J.setPendingFitSetup((G)=>I7(J,$,Q,G)),J.setLazyStartCapture(!0);let{absolute:Z=!1,resize:j=!1}=Q;J.setFitCleanup(()=>{if($ instanceof HTMLElement){if(S($,!0),j)$.style.width="",$.style.height="";if(Z)$.style.width="",$.style.height="",$.style.left="",$.style.top=""}})}U.fit={registerPendingSetup:O7};var $6=(J)=>J,L7=$6,E={in:(J)=>J*J,out:(J)=>J*(2-J),inOut:(J)=>J<0.5?2*J*J:-1+(4-2*J)*J},J0={in:(J)=>J*J*J,out:(J)=>--J*J*J+1,inOut:(J)=>J<0.5?4*J*J*J:(J-1)*(2*J-2)*(2*J-2)+1},$0={in:(J)=>J*J*J*J,out:(J)=>1- --J*J*J*J,inOut:(J)=>J<0.5?8*J*J*J*J:1-8*--J*J*J*J},p={in:(J)=>J*J*J*J*J,out:(J)=>1+--J*J*J*J*J,inOut:(J)=>J<0.5?16*J*J*J*J*J:1+16*--J*J*J*J*J};var f0={in:(J)=>1-Math.cos(J*Math.PI/2),out:(J)=>Math.sin(J*Math.PI/2),inOut:(J)=>-(Math.cos(Math.PI*J)-1)/2},u0={in:(J)=>2**(10*(J-1))*J+J*J*J*J*J*J*(1-J),out:(J)=>1-(2**(10*-J)*(1-J)+(1-J)*(1-J)*(1-J)*(1-J)*(1-J)*(1-J)*J),inOut:(J)=>{if(J<0.5){let Q=J*2;return(2**(10*(Q-1))*Q+Q*Q*Q*Q*Q*Q*(1-Q))/2}let $=(1-J)*2;return 1-(2**(10*($-1))*$+$*$*$*$*$*$*(1-$))/2}},d0={in:(J)=>1-Math.sqrt(1-J*J),out:(J)=>Math.sqrt(1- --J*J),inOut:(J)=>{if((J*=2)<1)return-0.5*(Math.sqrt(1-J*J)-1);return 0.5*(Math.sqrt(1-(J-=2)*J)+1)}};var Q6=(J=1.70158)=>{let $=(Q)=>Q?--Q*Q*((J+1)*Q+J)+1:0;return{in:(Q)=>1-$(1-Q),out:$,inOut:(Q)=>{if(Q<0.5)return(1-$(1-Q*2))/2;return 0.5+$((Q-0.5)*2)/2}}},p0=Q6();var q6=(J=1,$=0.3)=>{let Q=Math.max(1,J),q=$/(2*Math.PI)*Math.asin(1/Q),Z=$*1.5,j=Z/(2*Math.PI)*Math.asin(1/Q);return{in:(G)=>{if(G===0)return 0;if(G===1)return 1;return-(Q*Math.pow(2,10*(G-=1))*Math.sin((G-q)*(2*Math.PI)/$))},out:(G)=>{if(G===0)return 0;if(G===1)return 1;return Q*Math.pow(2,-10*G)*Math.sin((G-q)*(2*Math.PI)/$)+1},inOut:(G)=>{if(G===0)return 0;if(G===1)return 1;if((G*=2)<1)return-0.5*(Q*Math.pow(2,10*(G-=1))*Math.sin((G-j)*(2*Math.PI)/Z));return Q*Math.pow(2,-10*(G-=1))*Math.sin((G-j)*(2*Math.PI)/Z)*0.5+1}}},c0=q6(),tJ=(J)=>{if(J<0.36363636363636365)return 7.5625*J*J;else if(J<0.7272727272727273)return 7.5625*(J-=0.5454545454545454)*J+0.75;else if(J<0.9090909090909091)return 7.5625*(J-=0.8181818181818182)*J+0.9375;else return 7.5625*(J-=0.9545454545454546)*J+0.984375},X0={in:(J)=>1-tJ(1-J),out:tJ,inOut:(J)=>{if(J<0.5)return X0.in(J*2)*0.5;return X0.out(J*2-1)*0.5+0.5}},L0=(J=0.7,$=0.7,Q=!1)=>{let q=J!==1?$:0,Z=(1-J)/2,j=Z+J,G=Q;return(z)=>{let W=z+(0.5-z)*q;if(z<Z){let B=1-z/Z;if(G)return 1-B*B;return W-B*B*B*B*W}else if(z>j){let B=(z-j)/Z;if(G)return z===1?0:1-B*B;return W+(z-W)*B*B*B*B}return G?1:W}},eJ={in:L0(0.7,0.7,!1),out:L0(0.7,0.7,!1),inOut:L0(0.7,0.7,!1)},g0=(J=1,$=20,Q=!1)=>{let q=[],Z=1/$;for(let j=0;j<$;j++){let G=j*Z,W=((j*1327+531)%1000/1000-0.5)*J*0.4,B=G+W;q.push({x:G,y:Q?Math.max(0,Math.min(1,B)):B})}return q[0]={x:0,y:0},q.push({x:1,y:1}),(j)=>{if(j<=0)return 0;if(j>=1)return 1;let G=0,z=q.length-1;while(G<z-1){let _=G+z>>1;if(q[_].x<=j)G=_;else z=_}let W=q[G],B=q[z],N=(j-W.x)/(B.x-W.x);return W.y+(B.y-W.y)*N}},M7={in:g0(1,20,!0),out:g0(1,20,!0),inOut:g0(1,20,!0)},s0=(J)=>{return($)=>{if($>=1)return 1;return Math.floor($*J)/J}},m0={in:s0(12),out:s0(12),inOut:s0(12)},J6={linear:$6,none:L7,power1:E.out,"power1.in":E.in,"power1.out":E.out,"power1.inout":E.inOut,power2:J0.out,"power2.in":J0.in,"power2.out":J0.out,"power2.inout":J0.inOut,power3:$0.out,"power3.in":$0.in,"power3.out":$0.out,"power3.inout":$0.inOut,power4:p.out,"power4.in":p.in,"power4.out":p.out,"power4.inout":p.inOut,quad:E.out,"quad.in":E.in,"quad.out":E.out,"quad.inout":E.inOut,cubic:J0.out,"cubic.in":J0.in,"cubic.out":J0.out,"cubic.inout":J0.inOut,quart:$0.out,"quart.in":$0.in,"quart.out":$0.out,"quart.inout":$0.inOut,quint:p.out,"quint.in":p.in,"quint.out":p.out,"quint.inout":p.inOut,strong:p.out,"strong.in":p.in,"strong.out":p.out,"strong.inout":p.inOut,sine:f0.out,"sine.in":f0.in,"sine.out":f0.out,"sine.inout":f0.inOut,expo:u0.out,"expo.in":u0.in,"expo.out":u0.out,"expo.inout":u0.inOut,circ:d0.out,"circ.in":d0.in,"circ.out":d0.out,"circ.inout":d0.inOut,back:p0.out,"back.in":p0.in,"back.out":p0.out,"back.inout":p0.inOut,elastic:c0.out,"elastic.in":c0.in,"elastic.out":c0.out,"elastic.inout":c0.inOut,bounce:X0.out,"bounce.in":X0.in,"bounce.out":X0.out,"bounce.inout":X0.inOut,slow:eJ.inOut,"slow.in":E.out,"slow.out":E.out,"slow.inout":E.out,slowmo:eJ.inOut,"slowmo.in":E.out,"slowmo.out":E.out,"slowmo.inout":E.out,rough:M7.inOut,"rough.in":E.out,"rough.out":E.out,"rough.inout":E.out,steps:m0.inOut,"steps.in":m0.in,"steps.out":m0.out,"steps.inout":m0.inOut},k7={back:(J)=>Q6(J),elastic:(J,$)=>q6(J,$),slow:(J,$,Q)=>{let q=L0(J,$,Q===1);return{in:q,out:q,inOut:q}},slowmo:(J,$,Q)=>{let q=L0(J,$,Q===1);return{in:q,out:q,inOut:q}},rough:(J,$,Q)=>{let q=g0(J,$,Q===1);return{in:q,out:q,inOut:q}},steps:(J)=>{let $=s0(J??12);return{in:$,out:$,inOut:$}}},D7=/^(\w+)(?:\.(\w+))?\(([^)]*)\)$/;function Z6(J){let $=J.toLowerCase();if(J6[$])return J6[$];let Q=D7.exec($);if(Q){let[,q,Z,j]=Q,G=k7[q];if(G){let z=j.split(",").map((W)=>W.trim()).filter((W)=>W.length>0).map(Number);if(z.every((W)=>!isNaN(W))){let W=G(...z),B=Z||"out",_=W[B==="inout"?"inOut":B];if(_)return _}}}return console.warn(`[Motion] Unknown easing "${J}". Falling back to "power1.out". Valid easings: linear, power1-4.in/out/inOut, quad, cubic, quart, quint, strong, sine, expo, circ, back, elastic, bounce, slow, rough, steps. Parameterized: back.out(overshoot), elastic.out(amplitude, period), steps(n), slow(ratio, power, yoyo), rough(strength, points, clamp)`),E.out}class UJ{_id=0;_targets=[];_duration=0.5;_delay=0;_time=0;_progress=0;_timeScale=1;_isActive=!1;_isReversed=!1;_propTweens=null;_lastPropTween=null;_easingFn=null;_repeat=0;_repeatDelay=0;_yoyo=!1;_currentRepeat=0;_onStart;_onUpdate;_onComplete;_onRepeat;_onReverseComplete;_startFired=!1;_completeFired=!1;_timelineChild=!1;_needsStartCapture=!1;_startCaptured=!1;_fitSetupFn=null;_pendingFitSetup=null;_fitCleanupFn=null;_unregisterCallback=null;init(J,$,Q,q,Z,j){return this._id=J,this._targets=$,this._duration=Q,this._delay=q,this._easingFn=Z6(Z),this._time=0,this._progress=0,this._timeScale=1,this._isActive=!1,this._isReversed=!1,this._startFired=!1,this._completeFired=!1,this._currentRepeat=0,this._repeat=j?.repeat??0,this._repeatDelay=j?.repeatDelay??0,this._yoyo=j?.yoyo??!1,this._onStart=j?.onStart,this._onUpdate=j?.onUpdate,this._onComplete=j?.onComplete,this._onRepeat=j?.onRepeat,this._onReverseComplete=j?.onReverseComplete,this}update(J){if(!this._isActive)return;let $=J*this._timeScale;if(this._time+=this._isReversed?-$:$,!this._isReversed&&this._time<0){this._time=0;return}let Q=Math.max(0,this._time-this._delay);if(this._progress=this._duration>0?Math.min(1,Q/this._duration):1,!this._startFired&&this._progress>0)this._startFired=!0,this._onStart?.();if(this.render(this._progress),this._onUpdate?.(this._progress),this._isReversed){if(this._time<=0)this.handleComplete()}else if(this._progress>=1)this.handleComplete()}render(J){let $=this.applyEasing(J),Q=this._propTweens;while(Q)Q.render($),Q=Q.next}renderAtTime(J){let $=Math.max(0,J),Q=this._duration,q=this._delay,Z=this._currentRepeat;if(Q===0){let j=$>=q?1:0;this._time=$,this._progress=j,this.render(j)}else{let j=Math.max(0,$-q);if(this._repeat===0){let G=Math.min(1,j/Q);this._time=Math.min(Q,j),this._progress=G,this.render(G)}else{let G=this._repeatDelay,z=Q+G,W=this._repeat===-1?1/0:Q*(this._repeat+1)+G*this._repeat,B=this._repeat===-1?j:Math.min(j,W),N=z>0?Math.floor(B/z):0,_=B-N*z,X=_>Q,H=Q>0?Math.min(1,_/Q):1,Y=this._yoyo&&N%2===1;if(X)H=Y?0:1;else if(Y)H=1-H;this._currentRepeat=this._repeat===-1?N:Math.min(N,this._repeat),this._isReversed=Y,this._progress=H,this._time=Q*H,this.render(H)}}if(this._isActive){if(!this._startFired){this._startFired=!0;try{this._onStart?.()}catch(j){console.error("[Motion] onStart callback error:",j)}}try{this._onUpdate?.(this._progress)}catch(j){console.error("[Motion] onUpdate callback error:",j)}if(this._currentRepeat>Z)try{this._onRepeat?.(this._currentRepeat)}catch(j){console.error("[Motion] onRepeat callback error:",j)}if(!this._completeFired&&this._repeat!==-1){if($>=this.totalDuration()){this._completeFired=!0;try{this._onComplete?.()}catch(j){console.error("[Motion] onComplete callback error:",j)}}}}}applyEasing(J){if(!this._easingFn)return J;return this._easingFn(J)}handleComplete(){if(this._repeat===-1||this._currentRepeat<this._repeat){if(this._currentRepeat++,this._onRepeat?.(this._currentRepeat),this._yoyo)this._isReversed=!this._isReversed,this._time=this._isReversed?this._duration+this._delay:0;else this._time=0,this._startFired=!1;this._time-=this._repeatDelay;return}if(this._isReversed)this._onReverseComplete?.();else this._onComplete?.();this._isActive=!1}play(J){if(J!==void 0)return this.seek(J),this._isActive=!0,this._isReversed=!1,this;if(this._isActive&&!this._isReversed)return this;return this._isActive=!0,this._isReversed=!1,this}pause(J){if(J!==void 0){this._time=J;let $=Math.max(0,this._time-this._delay);this._progress=this._duration>0?Math.min(1,$/this._duration):1,this.render(this._progress)}return this._isActive=!1,this}reverse(J){if(J!==void 0)this.seek(J);return this._isActive=!0,this._isReversed=!0,this}restart(J=!0){return this._time=J?0:this._delay,this._progress=0,this._isActive=!0,this._isReversed=!1,this._startFired=!1,this._currentRepeat=0,this.render(0),this}seek(J){this._time=J;let $=Math.max(0,this._time-this._delay);return this._progress=this._duration>0?Math.min(1,$/this._duration):1,this.render(this._progress),this}progress(J){if(J===void 0)return this._progress;if(this._progress=Math.max(0,Math.min(1,J)),this._progress===0)this._time=0;else this._time=this._progress*this._duration+this._delay;return this.render(this._progress),this}time(J){if(J===void 0)return this._time;this._time=J;let $=Math.max(0,this._time-this._delay);return this._progress=this._duration>0?Math.min(1,$/this._duration):1,this.render(this._progress),this}timeScale(J){if(J===void 0)return this._timeScale;return this._timeScale=J,this}getTimeScale(){return this._timeScale}kill(){this._isActive=!1,this._unregisterCallback?.()}isActive(){return this._isActive}isTimelineChild(){return this._timelineChild}setTimelineChild(J){this._timelineChild=J}setLazyStartCapture(J){this._needsStartCapture=J,this._startCaptured=!1}setPendingFitSetup(J){this._fitSetupFn=J,this._pendingFitSetup=J}setFitCleanup(J){this._fitCleanupFn=J}resetForReplay(){if(this._fitSetupFn)this._fitCleanupFn?.(),this._pendingFitSetup=this._fitSetupFn,this._startCaptured=!1;this._startFired=!1,this._completeFired=!1}needsStartCapture(){return this._needsStartCapture&&!this._startCaptured}isLazyCapture(){return this._needsStartCapture}fireReverseComplete(){try{this._onReverseComplete?.()}catch(J){console.error("[Motion] onReverseComplete callback error:",J)}this._startFired=!1,this._completeFired=!1}setUnregisterCallback(J){this._unregisterCallback=J}captureStartValues(){if(!this._needsStartCapture||this._startCaptured)return;if(this._pendingFitSetup){let $=this._propTweens;while($){let Q=$.next;e.release($),$=Q}this._propTweens=null,this._lastPropTween=null,this._pendingFitSetup(e),this._pendingFitSetup=null,this._startCaptured=!0;return}let J=this._propTweens;while(J){if(J.target instanceof Element){let{target:$,property:Q}=J;if(J.valueType==="color"&&Z0(Q)){let q=U.color?.getCurrentColor($,Q);if(q&&J.endColor)J.startColor=q,J.changeColor=new Float32Array([J.endColor[0]-q[0],J.endColor[1]-q[1],J.endColor[2]-q[2],J.endColor[3]-q[3]])}else if(J.valueType==="filter"&&a(Q)){let q=U.filter?.getCurrentFilter($);if(q&&J.endFilters){let Z=U.filter.mergeFilterArrays(q,J.endFilters);J.startFilters=Z.start,J.endFilters=Z.end}}else{let q=n($,Q);J.startValue=q,J.change=J.endValue-J.startValue}}J=J.next}this._startCaptured=!0}getId(){return this._id}getTargets(){return this._targets}getDuration(){return this._duration}getDelay(){return this._delay}clearDelay(){this._delay=0}getFirstPropTween(){return this._propTweens}addPropTween(J){if(!this._lastPropTween)this._propTweens=J;else this._lastPropTween.next=J;this._lastPropTween=J}totalDuration(){if(this._repeat===-1)return 1/0;let $=this._duration*(this._repeat+1)+this._repeatDelay*this._repeat;return this._delay+$}reset(){this._id=0,this._targets=[],this._duration=0.5,this._delay=0,this._time=0,this._progress=0,this._timeScale=1,this._isActive=!1,this._isReversed=!1,this._easingFn=null,this._repeat=0,this._repeatDelay=0,this._yoyo=!1,this._currentRepeat=0,this._onStart=void 0,this._onUpdate=void 0,this._onComplete=void 0,this._onRepeat=void 0,this._onReverseComplete=void 0,this._startFired=!1,this._completeFired=!1,this._timelineChild=!1,this._needsStartCapture=!1,this._startCaptured=!1,this._fitSetupFn=null,this._pendingFitSetup=null,this._fitCleanupFn=null,this._unregisterCallback=null;let J=e,$=this._propTweens;while($){let Q=$.next;J.release($),$=Q}this._propTweens=null,this._lastPropTween=null}}var M0=new I0(()=>new UJ,100),j6={acquire:()=>M0.acquire(),release:(J)=>M0.release(J),getPoolSize:()=>M0.getPoolSize(),getTotalCreated:()=>M0.getTotalCreated(),clear:()=>M0.clear()};class x{static instance;animations=[];animationIdToIndex=new Map;nextAnimationId=1;totalCreated=0;_animationSnapshot=[];timelines=new Map;ticker;animationPool;propTweenPool;constructor(){this.ticker=V.getInstance(),this.animationPool=j6,this.propTweenPool=e,this.ticker.add(this.update,0)}static getInstance(){if(!x.instance)x.instance=new x,b.setEngineRegisterCallback((J,$)=>{let Q=x.instance;if(!Q.hasTimeline(J))Q.registerTimeline(J,$)}),d.setCreateAnimationCallback((J,$,Q,q,Z,j,G,z)=>{return x.instance.createAnimation(J,$,Q,q,Z,j,G,z)});return x.instance}update=(J)=>{let $=this._animationSnapshot,Q=this.animations.length;$.length=Q;for(let Z=0;Z<Q;Z++)$[Z]=this.animations[Z];let q=[];for(let Z=0,j=$.length;Z<j;Z++){let G=$[Z];if(G.isTimelineChild())continue;if(G.isActive()){if(G.update(J),!G.isActive()&&!G.isTimelineChild())q.push(G.getId())}}for(let Z of q)this.unregisterAnimation(Z);for(let Z of this.timelines.values())if(Z.isActive())Z.update(J)};createAnimation(J,$,Q,q,Z,j,G,z){let W=z?.stagger;if(W&&J.length>1)return this.createStaggeredAnimations(J,$,Q,q,Z,j,G,W,z);let B=this.animationPool.acquire(),N=this.registerAnimation(B);if(B.init(N,J,Q,q,Z,z),this.setupPropertyTweens(B,J,$,j,G),Q===0)B.render(1);else if(j&&!z?._skipInitialRender)B.render(0);return B}createStaggeredAnimations(J,$,Q,q,Z,j,G,z,W){if(!U.stagger){let _=this.animationPool.acquire(),X=this.registerAnimation(_);if(_.init(X,J,Q,q,Z,W),this.setupPropertyTweens(_,J,$,j,G),Q===0)_.render(1);else if(j&&!W?._skipInitialRender)_.render(0);return[_]}let B=U.stagger.resolve(J,z),N=[];for(let _=0;_<J.length;_++){let X=J[_],H=B[_],Y=this.animationPool.acquire(),F=this.registerAnimation(Y);if(Y.init(F,[X],Q,q+H,Z,W),this.setupPropertyTweens(Y,[X],$,j,G),Q===0)Y.render(1);else if(j&&!W?._skipInitialRender)Y.render(0);N.push(Y)}return N}setupPropertyTweens(J,$,Q,q,Z){let j=Object.keys(Q),G=Z?Object.keys(Z):[],z=[...new Set([...j,...G])],W=Q,B=Z,N="perspective"in W,_=B&&"perspective"in B,X=N&&_;for(let H of $){if(!X&&(N||_)&&H instanceof Element){let Y=N?W.perspective:B.perspective,F=typeof Y==="number"?Y:parseFloat(String(Y))||0;if(F>0)P(H,"perspective",F,"px"),H.style.transform=R(H)}for(let Y of z){if(Y==="perspective"&&!X)continue;let F=W[Y],K=vJ(H,Y,F,B?B[Y]:void 0),L=this.propTweenPool.acquire(),k=q&&!Z;switch(K.type){case"color":{let M=k?K.endColor:K.startColor,O=k?K.startColor:K.endColor;L.initColor(H,Y,M,O);break}case"filter":{let M=k?K.endFilters:K.startFilters,O=k?K.startFilters:K.endFilters;L.initFilter(H,Y,M,O);break}case"scalar":{let M=k?K.endValue:K.startValue,O=k?K.startValue:K.endValue;L.init(H,Y,M,O,K.unit);break}case"drawSVG":{let M=k?K.endDraw:K.startDraw,O=k?K.startDraw:K.endDraw;L.initDrawSVG(H,Y,M,O,K.length);break}case"path":{let M=k?K.endProgress:K.startProgress,O=k?K.startProgress:K.endProgress;L.initPath(H,Y,K.pathData,K.pathLength,M,O,K.rotate,K.alignOffset,K.pathOffset);break}}J.addPropTween(L)}}}registerAnimation(J){let $=this.nextAnimationId++,Q=this.animations.length;return this.animations.push(J),this.animationIdToIndex.set($,Q),this.totalCreated++,J.setUnregisterCallback(()=>this.unregisterAnimation($)),$}unregisterAnimation(J){let $=this.animationIdToIndex.get(J);if($===void 0)return;let Q=this.animations[$],q=this.animations.length-1;if($!==q){let Z=this.animations[q];this.animations[$]=Z,this.animationIdToIndex.set(Z.getId(),$)}this.animations.pop(),this.animationIdToIndex.delete(J),this.animationPool.release(Q)}getAnimation(J){let $=this.animationIdToIndex.get(J);return $!==void 0?this.animations[$]:void 0}killAll(){let J=[...this.animations];for(let $=0,Q=J.length;$<Q;$++)J[$].kill();this.animations.length=0,this.animationIdToIndex.clear()}killAnimationsForTargets(J){if(J.length===0)return;let $=new Set(J),Q=[];for(let q=0,Z=this.animations.length;q<Z;q++){let j=this.animations[q],G=j.getTargets();for(let z of G)if(z instanceof Element&&$.has(z)){Q.push(j);break}}for(let q of Q)q.kill()}getActiveCount(){let J=0;for(let $=0,Q=this.animations.length;$<Q;$++)if(this.animations[$].isActive())J++;return J}getTotalCreated(){return this.totalCreated}getTimeline(J){let $=this.timelines.get(J);if(!$){if($=new b(J),!this.timelines.has(J))this.timelines.set(J,$),$.setUnregisterCallback(()=>this.removeTimeline(J))}return $}hasTimeline(J){return this.timelines.has(J)}registerTimeline(J,$){this.timelines.set(J,$),$.setUnregisterCallback(()=>this.removeTimeline(J))}getTimelineCount(){return this.timelines.size}getTimelineNames(){return Array.from(this.timelines.keys())}removeTimeline(J){this.timelines.delete(J)}killAllTimelines(){for(let J of this.timelines.values())J.kill();this.timelines.clear()}killEverything(){this.killAllTimelines(),this.killAll(),wJ()}getAnimationPool(){return this.animationPool}getPropTweenPool(){return this.propTweenPool}getPoolStats(){return{animations:this.animationPool.getPoolSize(),propTweens:this.propTweenPool.getPoolSize()}}clearPools(){this.animationPool.clear(),this.propTweenPool.clear()}getMemoryEstimate(){let J=this.animations.length,$=this.animationPool.getPoolSize(),Q=this.propTweenPool.getPoolSize();return(J+$)*500+Q*100}getTicker(){return this.ticker}}function R7(J,$){if(typeof J==="string"){let Q=$||(typeof document<"u"?document:null);if(!Q)return[];try{return Array.from(Q.querySelectorAll(J))}catch{return[]}}if(typeof Element<"u"&&J instanceof Element)return[J];if(typeof NodeList<"u"&&J instanceof NodeList||typeof HTMLCollection<"u"&&J instanceof HTMLCollection)return Array.from(J);if(Array.isArray(J))return J;if(J&&typeof J==="object"&&"length"in J)return Array.from(J);return[]}function E7(J,$,Q){if(Q===void 0)return(q)=>Math.min($,Math.max(J,q));return Math.min($,Math.max(J,Q))}function b7(J,$,Q){let q=J+Math.random()*($-J);if(Q&&Q>0)return Math.round(q/Q)*Q;return q}function x7(J,$){let Q=(q)=>{if(typeof J==="number"){if(J<=0)return q;return Math.round(q/J)*J}let Z=J,j=Z[0],G=Math.abs(q-j);for(let z=1;z<Z.length;z++){let W=Math.abs(q-Z[z]);if(W<G)G=W,j=Z[z]}return j};if($===void 0)return Q;return Q($)}function V7(J,$,Q){return J+($-J)*Q}function C7(J,$,Q,q,Z){let j=(G)=>{let z=(G-J)/($-J);return Q+z*(q-Q)};if(Z===void 0)return j;return j(Z)}function w7(J,$,Q){let q=(Z)=>(Z-J)/($-J);if(Q===void 0)return q;return q(Q)}function P7(J,$,Q){let q=$-J,Z=(j)=>{return((j-J)%q+q)%q+J};if(Q===void 0)return Z;return Z(Q)}var FJ={toArray:R7,clamp:E7,random:b7,snap:x7,interpolate:V7,mapRange:C7,normalize:w7,wrap:P7};function m(J,$,Q){let Z=x.getInstance().getTimeline(J);if($!==void 0&&Z.duration()>0)console.warn(`[Motion] Timeline "${J}" already has animations. New entries will be appended. Call Motion("${J}").kill() first to rebuild from scratch.`);if(Array.isArray($)&&$.length>0&&typeof $[0]==="object"&&$[0]!==null&&"target"in $[0])for(let j of $)Z._addEntry(j.target,j,j.position);else if($!==void 0&&Q!==void 0)Z._addEntry($,Q);return Z}m.reset=function(J){x.getInstance();let $=k0(J),Q=[];for(let q of $)if(q instanceof Element)Q.push(q);if(Q.length>0)x.getInstance().killAnimationsForTargets(Q);for(let q of $){if(!(q instanceof Element))continue;if(U.textSplitter?.isSplit?.(q))U.textSplitter?.revert?.(q);S(q),U.styleReset?.clearAnimationStylesAndUnregister?.(q),U.styleReset?.clearPinStylesAndUnregister?.(q)}};m.set=function(J,$){x.getInstance();let Q=new b;Q._addEntry(J,{to:$,duration:0}),Q.kill(!1)};m.get=function(J){let $=x.getInstance();return $.hasTimeline(J)?$.getTimeline(J):void 0};m.has=function(J){return x.getInstance().hasTimeline(J)};m.getNames=function(){return x.getInstance().getTimelineNames()};m.kill=function(J){let $=x.getInstance();if($.hasTimeline(J))$.getTimeline(J).kill()};m.killAll=function(){x.getInstance().killEverything()};m.refreshScrollTriggers=function(){U.triggerManager?.getInstance?.()?.refreshScrollTriggers()};m.cleanup=function(){if(typeof document>"u")return;document.querySelectorAll("[data-scrolltrigger-spacer]").forEach((J)=>J.remove()),document.querySelectorAll("[data-scrolltrigger-markers]").forEach((J)=>J.remove())};m.utils=FJ;var S7=m;var y7={};export{y7 as Types,b as Timeline,FJ as MotionUtils,S7 as Motion};
|
|
31
|
+
`,M.appendChild(k),M},_=B("scroller-start",Q,"right"),X=B("scroller-end",Z,"right"),Y=B("start",Q,"left"),H=B("end",Z,"left");if(!this._triggerElement)Y.style.display="none",H.style.display="none";if(this._markerContainer.appendChild(_),this._markerContainer.appendChild(X),this._markerContainer.appendChild(Y),this._markerContainer.appendChild(H),this._markers={scrollerStart:_,scrollerEnd:X,elementStart:Y,elementEnd:H},q){let I=this._scroller;if(window.getComputedStyle(I).position==="static")I.style.position="relative";I.appendChild(this._markerContainer)}else document.body.appendChild(this._markerContainer),this._markerContainer.style.position="fixed";this._scrollerStartOffset=W,this._scrollerEndOffset=N,this._cacheElementPositions(G)}_cacheElementPositions(J){if(!this._triggerElement){this._cachedElPositionValid=!1;return}let $=d(this._triggerElement),Q=T(this._startConfig.split(" ")[0]||"top",$.height,J),Z=this._endConfig.startsWith("+=")?Q:T(this._endConfig.split(" ")[0]||"bottom",$.height,J);if(this._scroller!==window){let q=this._scroller.getBoundingClientRect(),G=this._scroller.scrollTop,z=$.top-q.top+G;this._cachedElStartDocTop=z+Q,this._cachedElEndDocTop=z+Z}else{let q=window.scrollY||window.pageYOffset||0,G=$.top+q;this._cachedElStartDocTop=G+Q,this._cachedElEndDocTop=G+Z}this._cachedElPositionValid=!0}update(J,$,Q){if(!this._markers||!this._markerContainer)return;let Z=this._triggerElement;if(this._triggerElement=$||void 0,this._triggerElement!==Z)this._cacheElementPositions(Q);let j=this._scroller!==window;if(j)this._markers.scrollerStart.style.top=`${J+this._scrollerStartOffset}px`,this._markers.scrollerEnd.style.top=`${J+this._scrollerEndOffset}px`;else this._markers.scrollerStart.style.top=`${this._scrollerStartOffset}px`,this._markers.scrollerEnd.style.top=`${this._scrollerEndOffset}px`;if(this._triggerElement&&this._cachedElPositionValid)if(this._markers.elementStart.style.display="",this._markers.elementEnd.style.display="",j)this._markers.elementStart.style.top=`${this._cachedElStartDocTop}px`,this._markers.elementEnd.style.top=`${this._cachedElEndDocTop}px`;else this._markers.elementStart.style.top=`${this._cachedElStartDocTop-J}px`,this._markers.elementEnd.style.top=`${this._cachedElEndDocTop-J}px`;else this._markers.elementStart.style.display="none",this._markers.elementEnd.style.display="none"}recachePositions(J){this._cacheElementPositions(J)}cleanup(){if(this._markerContainer&&this._markerContainer.parentNode)this._markerContainer.parentNode.removeChild(this._markerContainer);this._markerContainer=void 0,this._markers=void 0,this._triggerElement=void 0}}class a extends u{static _nextId=0;_id;static _SCRUB_TICKER_PRIORITY=1;static _activeInstances=new Set;static _loadListenerAdded=!1;_scrollListener;_scrubTickListener=null;_currentProgress=0;_targetProgress=0;_scrubLag=0;_scroller;_triggerStart=0;_triggerEnd=0;_pinManager=null;_markerManager=null;_triggerState="before";_toggleActions=["play","none","none","none"];_initializing=!1;constructor(J,$){super(J,$);this._id=a._nextId++,this._scrubLag=typeof $.scrub==="number"?$.scrub:0}static _ensureLoadListener(){if(a._loadListenerAdded||typeof window>"u")return;if(a._loadListenerAdded=!0,document.readyState==="complete")return;window.addEventListener("load",()=>{setTimeout(()=>{for(let J of a._activeInstances)J.refresh()},100)},{once:!0})}_resolveScroller(){if(this._config.scroller)if(typeof this._config.scroller==="string"){if(typeof document>"u"){this._scroller=window;return}try{let J=document.querySelector(this._config.scroller);this._scroller=J??window}catch(J){console.warn(`[Motion] Invalid scroller selector "${this._config.scroller}":`,J),this._scroller=window}}else this._scroller=this._config.scroller;else this._scroller=window}_resolvePinElement(){if(!this._config.pin||typeof document>"u")return null;let J=null;if(typeof this._config.pin==="string")J=document.querySelector(this._config.pin);else if(this._config.pin===!0)J=this._getFirstAnimatedElement();return J}_defaultStart(){return this._config.start||(this._config.pin?"top top":"top bottom")}_defaultEnd(){return this._config.end||"bottom top"}_getFirstAnimatedElement(){let J=this._timeline.getFirstChildBuilder();if(J){let Q=J.hasSplit()?J.getOriginalTargets():J.getTargets();for(let Z of Q)if(Z instanceof HTMLElement)return Z}let $=this._timeline.getFirstChildAnimation();if($){let Q=$.getTargets();if(Q.length>0&&Q[0]instanceof HTMLElement)return Q[0]}return null}_resolveTriggerElement(){if(this._config.target instanceof HTMLElement)return this._config.target;if(typeof this._config.target==="string"&&typeof document<"u"){let J=document.querySelector(this._config.target);if(J instanceof HTMLElement)return J}return this._getFirstAnimatedElement()}_calculateTriggerPositions(J){let $=J||this._resolveTriggerElement(),Q=this._getViewportHeight(),Z=this._getScrollTop();if(!$){this._triggerStart=0,this._triggerEnd=this._getScrollHeight();return}let j=this._pinManager?.getLayoutRect()??d($),q;if(this._scroller instanceof Element){let Y=this._scroller.getBoundingClientRect();q=j.top-Y.top+Z}else q=j.top+Z;let z=this._defaultStart().split(" "),W=z[0]||"top",N=z[1]||"top",B=T(W,j.height,Q),_=T(N,Q,Q);this._triggerStart=q+B-_;let X=this._defaultEnd();if(X.startsWith("+=")){let Y=T(X.slice(2),Q,Q);this._triggerEnd=this._triggerStart+Y}else{let Y=X.split(" "),H=Y[0]||"bottom",I=Y[1]||"top",K=T(H,j.height,Q),F=T(I,Q,Q);this._triggerEnd=q+K-F}if(this._triggerEnd<=this._triggerStart)this._triggerEnd=this._triggerStart+Math.max(Q,100)}_onEnable(){this._resolveScroller();let J=this._resolvePinElement();this._calculateTriggerPositions(J),a._activeInstances.add(this),a._ensureLoadListener();let Q=(this._config.toggleActions||"play none none none").trim().split(/\s+/);if(this._toggleActions=[Q[0],Q[1],Q[2],Q[3]],J){let j=this._defaultStart().split(" "),q=this._getViewportHeight(),G=T(j[0]||"top",J.getBoundingClientRect().height,q),W=T(j[1]||"top",q,q)-G;this._pinManager=w.getOrCreate(this._id,J),this._pinManager.setup(J,this._triggerStart,this._triggerEnd,W,this._scroller===window,this._config.pinSpacing)}if(this._config.markers&&typeof document<"u"){let Z=this._pinManager?.getElement()||this._resolveTriggerElement();this._markerManager=new NJ(this._id),this._markerManager.setup({scroller:this._scroller,triggerElement:Z,startConfig:this._defaultStart(),endConfig:this._defaultEnd(),markerConfig:this._config.markers,viewportHeight:this._getViewportHeight()})}if(this._scrollListener=()=>this._onScroll(),this._scroller){if(this._scroller.addEventListener("scroll",this._scrollListener,{passive:!0}),this._initializing=!0,this._onScroll(),this._initializing=!1,this._config.scrub===!1||this._config.scrub===void 0){if(this._triggerState==="active")S(this._toggleActions[0],this._timeline);else if(this._triggerState==="after")this._timeline.progress(1),this._timeline.pause()}}}_onDisable(){if(this._scrollListener&&this._scroller)this._scroller.removeEventListener("scroll",this._scrollListener);if(this._markerManager?.cleanup(),this._markerManager=null,this._pinManager){let J=this._pinManager.getElement();if(J)w.release(this._id,J);else this._pinManager.cleanup();this._pinManager=null}this._stopSmoothScrollLoop(),a._activeInstances.delete(this)}refresh(){if(!this._enabled)return;let J=this._pinManager?.getElement()||null,$=this._pinManager?.suspendHtmlHeight?.()??null;if(this._calculateTriggerPositions(J),$?.(),this._pinManager&&J){let Z=this._defaultStart().split(" "),j=this._getViewportHeight(),q=this._pinManager.getLayoutRect()?.height??J.getBoundingClientRect().height,G=T(Z[0]||"top",q,j),W=T(Z[1]||"top",j,j)-G;this._pinManager.setup(J,this._triggerStart,this._triggerEnd,W,this._scroller===window,this._config.pinSpacing)}if(this._markerManager)this._markerManager.recachePositions(this._getViewportHeight());this._onScroll()}_getViewportHeight(){if(this._scroller===window)return typeof window<"u"?window.innerHeight:0;else if(this._scroller instanceof Element)return this._scroller.clientHeight;return 0}_getScrollTop(){if(this._scroller===window)return typeof window<"u"?window.scrollY||window.pageYOffset:0;else if(this._scroller instanceof Element)return this._scroller.scrollTop;return 0}_getScrollHeight(){if(this._scroller===window){if(typeof document<"u"&&document.documentElement)return document.documentElement.scrollHeight-window.innerHeight;return 0}else if(this._scroller instanceof Element)return this._scroller.scrollHeight-this._scroller.clientHeight;return 0}_onScroll(){if(!this._enabled)return;let J=this._getScrollTop(),$=this._triggerEnd-this._triggerStart,Q=$>0?(J-this._triggerStart)/$:0;if(Q=Math.max(0,Math.min(1,Q)),Q=this._applySnap(Q),this._targetProgress=Q,this._pinManager?.update(J),this._markerManager){let Z=this._pinManager?.getElement()||this._resolveTriggerElement();this._markerManager.update(J,Z,this._getViewportHeight())}if(this._config.scrub!==!1&&this._config.scrub!==void 0)if(this._scrubLag===0)this._currentProgress=this._targetProgress,QJ(()=>this._timeline.progress(this._currentProgress));else this._startSmoothScrollLoop();else{let Z;if(Q<=0)Z="before";else if(Q>=1)Z="after";else Z="active";if(Z!==this._triggerState){let j=this._triggerState;if(this._triggerState=Z,this._initializing)return;QJ(()=>{if(Z==="active"&&j==="before")S(this._toggleActions[0],this._timeline);else if(Z==="after"&&j==="active")S(this._toggleActions[1],this._timeline);else if(Z==="active"&&j==="after")S(this._toggleActions[2],this._timeline);else if(Z==="before"&&j==="active")S(this._toggleActions[3],this._timeline);else if(Z==="after"&&j==="before")S(this._toggleActions[0],this._timeline),this._timeline.progress(1),S(this._toggleActions[1],this._timeline);else if(Z==="before"&&j==="after")S(this._toggleActions[2],this._timeline),this._timeline.progress(0),S(this._toggleActions[3],this._timeline)})}}}_applySnap(J){let $=this._config.snap;if($==null)return J;if(typeof $==="function")return $(J);if(Array.isArray($)){let Q=$[0]??J,Z=Math.abs(J-Q);for(let j=1;j<$.length;j++){let q=Math.abs(J-$[j]);if(q<Z)Z=q,Q=$[j]}return Q}if(typeof $==="number"&&$>0)return Math.round(J/$)*$;return J}_startSmoothScrollLoop(){if(this._scrubTickListener)return;this._scrubTickListener=(J,$)=>{if(!this._enabled){this._stopSmoothScrollLoop();return}let Q=this._targetProgress-this._currentProgress,Z=1-Math.exp(-J*3/this._scrubLag);if(this._currentProgress+=Q*Z,Math.abs(this._targetProgress-this._currentProgress)<0.0001){this._currentProgress=this._targetProgress,this._timeline.progress(this._currentProgress),this._stopSmoothScrollLoop();return}this._timeline.progress(this._currentProgress)},C.getInstance().add(this._scrubTickListener,a._SCRUB_TICKER_PRIORITY)}_stopSmoothScrollLoop(){if(this._scrubTickListener)C.getInstance().remove(this._scrubTickListener),this._scrubTickListener=null}}L.registerTrigger("scroll",a);class uJ{_registrations=[];_domContentLoaded=!1;_windowLoaded=!1;_initialized=!1;constructor(){this._initialize()}_initialize(){if(this._initialized)return;if(this._initialized=!0,typeof document<"u"){if(document.addEventListener("DOMContentLoaded",()=>{this._domContentLoaded=!0,this._triggerDuring()}),typeof window<"u")window.addEventListener("load",()=>{this._windowLoaded=!0,this._triggerAfter()});if(document.readyState==="interactive"||document.readyState==="complete")this._domContentLoaded=!0;if(document.readyState==="complete")this._windowLoaded=!0}}register(J,$){let Q=$.timing||"during",Z=$.paused===!0;if(this._registrations.push({timeline:J,timing:Q,paused:Z}),Z)return;if(Q==="before")J.play();else if(Q==="during"&&this._domContentLoaded)J.play();else if(Q==="after"&&this._windowLoaded)J.play()}unregister(J){this._registrations=this._registrations.filter(($)=>$.timeline!==J)}clear(){this._registrations=[]}_triggerDuring(){this._registrations.filter((J)=>J.timing==="during"&&!J.paused).forEach((J)=>J.timeline.play())}_triggerAfter(){this._registrations.filter((J)=>J.timing==="after"&&!J.paused).forEach((J)=>J.timeline.play())}_reset(){this._registrations=[],this._domContentLoaded=!1,this._windowLoaded=!1,this._initialized=!1,this._initialize()}}L.registerPageLoadTrigger(uJ);class dJ extends u{_targets=[];_listeners=new Map;_frozenRects=new Map;_state={x:0.5,y:0.5,distance:0.5,isInside:!1};_targetState={targetX:0.5,targetY:0.5,targetDistance:0.5};_tickerCallback;_defaultStartProgress=0.5;_defaultLeaveProgress=0.5;constructor(J,$){super(J,$);this._config={type:"distance",startProgress:this._defaultStartProgress,leaveProgress:this._defaultLeaveProgress,...$};let Q=this._config.startProgress??this._defaultStartProgress;this._state.x=Q,this._state.y=Q,this._state.distance=Q,this._targetState.targetX=Q,this._targetState.targetY=Q,this._targetState.targetDistance=Q}_onEnable(){if(this._targets=this._resolveElements(this._config.target),this._targets.length===0)this._addViewportListeners();else this._addTargetListeners();if(this._config.smooth!==void 0&&this._config.smooth>0)this._startSmoothingTicker();this._updateTimelineProgress()}_onDisable(){if(this._tickerCallback)C.getInstance().remove(this._tickerCallback),this._tickerCallback=void 0;this._frozenRects.clear(),this._cleanupListenerMap(this._listeners)}_addViewportListeners(){if(typeof window>"u")return;let J=new Map,$=(Q)=>{let Z=Q;this._handleViewportMouseMove(Z.clientX,Z.clientY)};window.addEventListener("mousemove",$),J.set("mousemove",$),this._state.isInside=!0,this._listeners.set(window,J)}refresh(){for(let J of this._targets)this._frozenRects.set(J,d(J))}_addTargetListeners(){this._targets.forEach((J)=>{this._frozenRects.set(J,d(J));let $=new Map,Q=(q)=>{let G=q;this._handleTargetMouseMove(J,G.clientX,G.clientY)};J.addEventListener("mousemove",Q),$.set("mousemove",Q);let Z=()=>{this._state.isInside=!0};J.addEventListener("mouseenter",Z),$.set("mouseenter",Z);let j=()=>{this._state.isInside=!1,this._handleMouseLeave()};J.addEventListener("mouseleave",j),$.set("mouseleave",j),this._listeners.set(J,$)})}_handleViewportMouseMove(J,$){if(typeof window>"u")return;let{innerWidth:Q,innerHeight:Z}=window,j=Q/2,q=Z/2;if(this._config.type==="axis")this._targetState.targetX=J/Q,this._targetState.targetY=$/Z;else{let G=J-j,z=$-q,W=Math.sqrt(G*G+z*z),N=Math.sqrt(j*j+q*q);this._targetState.targetDistance=1-Math.min(W/N,1)}this._applyProgress()}_handleTargetMouseMove(J,$,Q){let Z=this._frozenRects.get(J)??J.getBoundingClientRect(),j=Z.left+Z.width/2,q=Z.top+Z.height/2;if(this._config.type==="axis"){let G=$-Z.left,z=Q-Z.top;this._targetState.targetX=Math.max(0,Math.min(1,G/Z.width)),this._targetState.targetY=Math.max(0,Math.min(1,z/Z.height))}else{let G=$-j,z=Q-q,W=Math.sqrt(G*G+z*z),N=Math.sqrt(Math.pow(Z.width/2,2)+Math.pow(Z.height/2,2));this._targetState.targetDistance=1-Math.min(W/N,1)}this._applyProgress()}_handleMouseLeave(){let J=this._config.leaveProgress??this._defaultLeaveProgress;if(this._targetState.targetX=J,this._targetState.targetY=J,this._targetState.targetDistance=J,!this._config.smooth)this._state.x=J,this._state.y=J,this._state.distance=J,this._updateTimelineProgress()}_applyProgress(){if(this._config.smooth)return;this._state.x=this._targetState.targetX,this._state.y=this._targetState.targetY,this._state.distance=this._targetState.targetDistance,this._updateTimelineProgress()}_startSmoothingTicker(){let J=Math.max(0,Math.min(1,this._config.smooth??0.1));this._tickerCallback=($)=>{let Q=this._lerp(this._state.x,this._targetState.targetX,J,$),Z=this._lerp(this._state.y,this._targetState.targetY,J,$),j=this._lerp(this._state.distance,this._targetState.targetDistance,J,$),q=0.0001,G=Math.abs(Q-this._state.x)<0.0001&&Math.abs(Q-this._targetState.targetX)<0.0001,z=Math.abs(Z-this._state.y)<0.0001&&Math.abs(Z-this._targetState.targetY)<0.0001,W=Math.abs(j-this._state.distance)<0.0001&&Math.abs(j-this._targetState.targetDistance)<0.0001;if(this._state.x=Q,this._state.y=Z,this._state.distance=j,!G||!z||!W)this._updateTimelineProgress()},C.getInstance().add(this._tickerCallback)}_lerp(J,$,Q,Z){let j=$-J;if(Math.abs(j)<0.0001)return $;let q=0.5*Math.pow(1-Q,2)+0.005,G=1-Math.pow(1-q,Z*60);return J+j*G}_updateTimelineProgress(){if(this._config.type==="axis")this._timeline.setAxisProgress("x",this._state.x),this._timeline.setAxisProgress("y",this._state.y);else this._timeline.progress(this._state.distance)}}L.registerTrigger("mouseMove",dJ);class A0 extends u{_target=window;_tolerance;_dragMinimum;_dragMinimumSquared;_wheelSpeed;_scrollSpeed;_stopDelay;_preventDefault;_lockAxis;_animationStep;_smooth;_startX=0;_startY=0;_deltaX=0;_deltaY=0;_lockedAxis=null;_isPressed=!1;_isDragging=!1;_lastDirectionX=null;_lastDirectionY=null;_lastScrollX=0;_lastScrollY=0;_stopTimeout=null;_isMoving=!1;_lastActivityTime=0;_pendingActions=new Map;_rafScheduled=!1;_rafId=null;_wheelAccumulatorX=0;_wheelAccumulatorY=0;_wheelRafId=null;_scrollRafId=null;_lastPointerX=0;_lastPointerY=0;_activatedDirections=new Set;_targetProgress=0;_currentProgress=0;_interpolationRafId=null;_siblings=null;_index=0;static _sequenceStates=new WeakMap;_boundHandlers={};_frozenHoverRect=null;_gestureHoverActive=!1;_boundHoverMoveHandler=null;constructor(J,$){super(J,$);this._tolerance=$.tolerance??1,this._dragMinimum=$.dragMinimum??10,this._dragMinimumSquared=this._dragMinimum*this._dragMinimum,this._wheelSpeed=$.wheelSpeed??1,this._scrollSpeed=$.scrollSpeed??1,this._stopDelay=$.stopDelay??150,this._preventDefault=$.preventDefault??!1,this._lockAxis=$.lockAxis??!1,this._animationStep=$.animationStep??0.1,this._smooth=Math.max(0,Math.min(1,$.smooth??0));let Q=$;if(Q._siblings&&Q._index!==void 0){if(this._siblings=Q._siblings,this._index=Q._index,!A0._sequenceStates.has(this._siblings))A0._sequenceStates.set(this._siblings,{lastIndex:0})}}_onEnable(){let J=this._resolveElement(this._config.target,window);this._target=J??window;let $=this._config.types;if($.includes("pointer"))this._addPointerListeners();if($.includes("touch"))this._addTouchListeners();if($.includes("wheel"))this._addWheelListener();if($.includes("scroll"))this._addScrollListener();if(this._config.events.Hover||this._config.events.HoverEnd)this._addHoverListeners()}_onDisable(){if(this._stopTimeout)clearTimeout(this._stopTimeout),this._stopTimeout=null;if(this._rafId!==null)cancelAnimationFrame(this._rafId),this._rafId=null;if(this._wheelRafId!==null)cancelAnimationFrame(this._wheelRafId),this._wheelRafId=null;if(this._scrollRafId!==null)cancelAnimationFrame(this._scrollRafId),this._scrollRafId=null;if(this._interpolationRafId!==null)cancelAnimationFrame(this._interpolationRafId),this._interpolationRafId=null;this._rafScheduled=!1,this._pendingActions.clear();let J=this._target;if(this._boundHandlers.pointerDown)J.removeEventListener("pointerdown",this._boundHandlers.pointerDown),window.removeEventListener("pointermove",this._boundHandlers.pointerMove),window.removeEventListener("pointerup",this._boundHandlers.pointerUp);if(this._boundHandlers.touchStart)J.removeEventListener("touchstart",this._boundHandlers.touchStart),window.removeEventListener("touchmove",this._boundHandlers.touchMove),window.removeEventListener("touchend",this._boundHandlers.touchEnd);if(this._boundHandlers.wheel)J.removeEventListener("wheel",this._boundHandlers.wheel);if(this._boundHandlers.scroll)(this._target===window?window:this._target).removeEventListener("scroll",this._boundHandlers.scroll);if(this._boundHoverMoveHandler)window.removeEventListener("mousemove",this._boundHoverMoveHandler),this._boundHoverMoveHandler=null;this._frozenHoverRect=null,this._gestureHoverActive=!1,this._boundHandlers={}}_addPointerListeners(){this._boundHandlers.pointerDown=this._handlePointerDown.bind(this),this._boundHandlers.pointerMove=this._handlePointerMove.bind(this),this._boundHandlers.pointerUp=this._handlePointerUp.bind(this);let J={passive:!this._preventDefault};this._target.addEventListener("pointerdown",this._boundHandlers.pointerDown,J),window.addEventListener("pointermove",this._boundHandlers.pointerMove,J),window.addEventListener("pointerup",this._boundHandlers.pointerUp)}_handlePointerDown(J){if(J.pointerType==="touch"&&this._config.types.includes("touch"))return;if(this._preventDefault)J.preventDefault();this._handleInputStart(J.clientX,J.clientY)}_handlePointerMove(J){if(J.pointerType==="touch"&&this._config.types.includes("touch"))return;if(this._handleInputMove(J.clientX,J.clientY)){if(this._preventDefault)J.preventDefault()}}_handlePointerUp(J){if(J.pointerType==="touch"&&this._config.types.includes("touch"))return;this._handleInputEnd()}_addTouchListeners(){this._boundHandlers.touchStart=this._handleTouchStart.bind(this),this._boundHandlers.touchMove=this._handleTouchMove.bind(this),this._boundHandlers.touchEnd=this._handleTouchEnd.bind(this);let J={passive:!this._preventDefault};this._target.addEventListener("touchstart",this._boundHandlers.touchStart,J),window.addEventListener("touchmove",this._boundHandlers.touchMove,J),window.addEventListener("touchend",this._boundHandlers.touchEnd)}_handleTouchStart(J){if(this._preventDefault)J.preventDefault();let $=J.touches[0];if(!$)return;this._handleInputStart($.clientX,$.clientY)}_handleTouchMove(J){let $=J.touches[0];if(!$)return;if(this._handleInputMove($.clientX,$.clientY)){if(this._preventDefault)J.preventDefault()}}_handleTouchEnd(J){this._handleInputEnd()}_handleInputStart(J,$){this._fireEvent("PressInit"),this._startX=J,this._startY=$,this._lastPointerX=J,this._lastPointerY=$,this._deltaX=0,this._deltaY=0,this._isPressed=!0,this._isDragging=!1,this._lockedAxis=null,this._fireEvent("Press")}_handleInputMove(J,$){if(!this._isPressed)return!1;let Q=J-this._lastPointerX,Z=$-this._lastPointerY;if(Math.abs(Q)<1&&Math.abs(Z)<1)return!1;this._lastPointerX=J,this._lastPointerY=$;let j=J-this._startX,q=$-this._startY;if(this._updateDeltas(j,q),this._checkDragStart(),this._checkDirectionAndFire(!1),this._checkToggle(j,q),this._scheduleStopCheck(),this._isDragging)this._fireEvent("Drag");return!0}_handleInputEnd(){if(!this._isPressed)return;if(this._isDragging)this._fireEvent("DragEnd");this._fireEvent("Release"),this._fireCompleteCallbacks(),this._fireEvent("Stop"),this._resetGestureState()}_addWheelListener(){this._boundHandlers.wheel=this._handleWheel.bind(this),this._target.addEventListener("wheel",this._boundHandlers.wheel,{passive:!this._preventDefault})}_handleWheel(J){if(this._preventDefault)J.preventDefault();if(this._wheelAccumulatorX+=J.deltaX*this._wheelSpeed,this._wheelAccumulatorY+=J.deltaY*this._wheelSpeed,this._wheelRafId!==null)return;this._wheelRafId=requestAnimationFrame(()=>{this._wheelRafId=null,this._deltaX=this._wheelAccumulatorX,this._deltaY=this._wheelAccumulatorY,this._wheelAccumulatorX=0,this._wheelAccumulatorY=0,this._checkDirectionAndFire(!0),this._checkToggle(this._deltaX,this._deltaY),this._scheduleStopCheck(),this._deltaX=0,this._deltaY=0})}_addScrollListener(){if(this._boundHandlers.scroll=this._handleScroll.bind(this),this._target===window)this._lastScrollX=window.scrollX,this._lastScrollY=window.scrollY;else{let J=this._target;this._lastScrollX=J.scrollLeft,this._lastScrollY=J.scrollTop}this._target.addEventListener("scroll",this._boundHandlers.scroll,{passive:!0})}_handleScroll(){if(this._scrollRafId!==null)return;this._scrollRafId=requestAnimationFrame(()=>{this._scrollRafId=null,this._processScroll()})}_processScroll(){let J,$;if(this._target===window)J=window.scrollX,$=window.scrollY;else{let j=this._target;J=j.scrollLeft,$=j.scrollTop}let Q=(J-this._lastScrollX)*this._scrollSpeed,Z=($-this._lastScrollY)*this._scrollSpeed;this._lastScrollX=J,this._lastScrollY=$,this._deltaX=Q,this._deltaY=Z,this._checkDirectionAndFire(!0),this._checkToggle(Q,Z),this._scheduleStopCheck(),this._deltaX=0,this._deltaY=0}_addHoverListeners(){if(this._target===window)return;let J=this._target;this._frozenHoverRect=d(J),this._boundHoverMoveHandler=($)=>{if(!this._frozenHoverRect)return;let Q=this._frozenHoverRect,Z=$.clientX>=Q.left&&$.clientX<=Q.right&&$.clientY>=Q.top&&$.clientY<=Q.bottom;if(Z&&!this._gestureHoverActive)this._gestureHoverActive=!0,this._fireEvent("Hover");else if(!Z&&this._gestureHoverActive)this._gestureHoverActive=!1,this._fireEvent("HoverEnd")},window.addEventListener("mousemove",this._boundHoverMoveHandler)}refresh(){if(this._target===window||!this._frozenHoverRect)return;this._frozenHoverRect=d(this._target)}_updateDeltas(J,$){if(this._lockAxis&&this._lockedAxis)if(this._lockedAxis==="x")this._deltaX=J,this._deltaY=0;else this._deltaX=0,this._deltaY=$;else this._deltaX=J,this._deltaY=$;if(this._lockAxis&&!this._lockedAxis){let Q=this._tolerance;if(Math.abs(this._deltaX)>Q||Math.abs(this._deltaY)>Q)this._lockedAxis=Math.abs(this._deltaX)>Math.abs(this._deltaY)?"x":"y"}}_checkDirectionAndFire(J){let $=this._tolerance;if(J||!this._lockedAxis||this._lockedAxis==="y"){if(this._deltaY<-$){if(this._fireEvent("Up"),!J)this._activatedDirections.add("Up")}if(this._deltaY>$){if(this._fireEvent("Down"),!J)this._activatedDirections.add("Down")}}if(J||!this._lockedAxis||this._lockedAxis==="x"){if(this._deltaX<-$){if(this._fireEvent("Left"),!J)this._activatedDirections.add("Left")}if(this._deltaX>$){if(this._fireEvent("Right"),!J)this._activatedDirections.add("Right")}}if(Math.abs(this._deltaX)>$||Math.abs(this._deltaY)>$){if(this._fireEvent("Change"),Math.abs(this._deltaX)>$)this._fireEvent("ChangeX");if(Math.abs(this._deltaY)>$)this._fireEvent("ChangeY")}}_checkToggle(J,$){let Q=this._tolerance;if(Math.abs(J)>=Q){let Z=J>0?1:-1;if(this._lastDirectionX!==null&&Z!==this._lastDirectionX)this._fireEvent("ToggleX");this._lastDirectionX=Z}if(Math.abs($)>=Q){let Z=$>0?1:-1;if(this._lastDirectionY!==null&&Z!==this._lastDirectionY)this._fireEvent("ToggleY");this._lastDirectionY=Z}}_checkDragStart(){if(this._isDragging)return;if(this._deltaX*this._deltaX+this._deltaY*this._deltaY>this._dragMinimumSquared)this._isDragging=!0}_scheduleStopCheck(){if(this._isMoving=!0,this._lastActivityTime=performance.now(),this._stopTimeout)return;let J=()=>{let $=performance.now()-this._lastActivityTime;if($>=this._stopDelay){if(this._stopTimeout=null,this._isMoving){if(this._isMoving=!1,this._lastDirectionX=null,this._lastDirectionY=null,!this._isPressed)this._fireEvent("Stop")}}else this._stopTimeout=setTimeout(J,this._stopDelay-$)};this._stopTimeout=setTimeout(J,this._stopDelay)}_fireEvent(J){let $=this._config.events[J];if($)this._pendingActions.set($,J),this._scheduleRAF()}_scheduleRAF(){if(this._rafScheduled)return;this._rafScheduled=!0,this._rafId=requestAnimationFrame(()=>{this._rafScheduled=!1,this._rafId=null;for(let[J,$]of this._pendingActions)this._executeAction(J,$);this._pendingActions.clear()})}_getStepForEvent(J){if(typeof this._animationStep==="number")return this._animationStep;if(J&&this._animationStep[J]!==void 0)return this._animationStep[J];let $=Object.values(this._animationStep);return $.length>0?$[0]:0.1}_executeAction(J,$){switch(J){case"play":case"pause":case"reverse":case"restart":case"reset":case"complete":S(J,this._timeline);break;case"toggle":if(this._timeline.isActive())this._timeline.pause();else this._timeline.play();break;case"kill":this._timeline.kill();break;case"playReverse":{let Q=this._timeline.progress();if(Q>=1)this._timeline.reverse();else if(Q<=0)this._timeline.play();else if(!this._timeline.isActive())if(this._timeline.reversed())this._timeline.play();else this._timeline.reverse();break}case"progressUp":this._interpolateProgress(this._getStepForEvent($));break;case"progressDown":this._interpolateProgress(-this._getStepForEvent($));break;case"playNext":this._playSequenceItem(1);break;case"playPrevious":this._playSequenceItem(-1);break}}_playSequenceItem(J){if(!this._siblings||this._siblings.length===0)return;let $=A0._sequenceStates.get(this._siblings);if(!$)return;let Q=this._siblings.length,Z=$.lastIndex,j=(Z+J+Q)%Q,q=this._siblings[Z];if(q&&q.progress()>0)q.reverse();let G=this._siblings[j];if(G)G.restart();$.lastIndex=j}_interpolateProgress(J){let $=this._timeline.progress();if(Math.abs($-this._currentProgress)>0.01)this._currentProgress=$,this._targetProgress=$;if(this._interpolationRafId===null)this._currentProgress=$,this._targetProgress=$;if(this._targetProgress=Math.max(0,Math.min(1,this._targetProgress+J)),this._smooth===0){this._currentProgress=this._targetProgress,this._timeline.progress(this._currentProgress);return}if(this._interpolationRafId===null)this._startInterpolationLoop()}_startInterpolationLoop(){if(this._interpolationRafId!==null)return;let J=0.08+(1-this._smooth)*0.12,$=()=>{let Q=this._targetProgress-this._currentProgress;if(Math.abs(Q)<0.0001){this._currentProgress=this._targetProgress,this._timeline.progress(this._currentProgress),this._interpolationRafId=null;return}this._currentProgress+=Q*J,this._timeline.progress(this._currentProgress),this._interpolationRafId=requestAnimationFrame($)};this._interpolationRafId=requestAnimationFrame($)}_fireCompleteCallbacks(){if(this._activatedDirections.has("Up"))this._fireEvent("UpComplete");if(this._activatedDirections.has("Down"))this._fireEvent("DownComplete");if(this._activatedDirections.has("Left"))this._fireEvent("LeftComplete");if(this._activatedDirections.has("Right"))this._fireEvent("RightComplete");this._activatedDirections.clear()}_resetGestureState(){this._isPressed=!1,this._isDragging=!1,this._deltaX=0,this._deltaY=0,this._lockedAxis=null,this._lastDirectionX=null,this._lastDirectionY=null,this._activatedDirections.clear()}}L.registerTrigger("gesture",A0);var P0=null;function pJ(J,$,Q,Z){let j=J;if(!j.style)return;let q=N0();if(h($))if(y(J,$,Q,Z),q)C0(J);else j.style.transform=R(J);else{let G=Z?`${Q}${Z}`:`${Q}`;if(q)V0(J,$,G);else try{if(t($))j.style.setProperty($,G);else if($ in j.style)j.style[$]=G;else j.style.setProperty(n($),G)}catch{}}}function cJ(J,$,Q,Z,j,q){let G=J;if(!G.style)return;let z=q===1?`rgb(${Math.round(Q)}, ${Math.round(Z)}, ${Math.round(j)})`:`rgba(${Math.round(Q)}, ${Math.round(Z)}, ${Math.round(j)}, ${q})`;if(N0())V0(J,$,z);else try{if(t($))G.style.setProperty($,z);else if($ in G.style)G.style[$]=z;else G.style.setProperty(n($),z)}catch{}}function mJ(J,$,Q,Z){let j=J;if(!j.style)return;if(P0||(P0=U.filter)){let q=P0.interpolateFilters($,Q,Z),G=P0.filterToString(q);if(N0())V0(J,"filter",G);else j.style.filter=G}}function gJ(J,$,Q){let{pathLUT:Z,alignOffset:j,pathOffset:q,pathRotate:G}=Q;if(!Z||Z.length===0)return;let z=$*(Z.length-1),W=Math.floor(z),N=Math.min(W+1,Z.length-1),B=z-W,_=Z[W],X=Z[N],Y=_.x+(X.x-_.x)*B,H=_.y+(X.y-_.y)*B,I=(q?.x??0)+Y-(j?.x??0),K=(q?.y??0)+H-(j?.y??0);if(y(J,"x",I,"px"),y(J,"y",K,"px"),G){let F=l6(_.angle,X.angle,B);y(J,"rotate",F,"deg")}if(N0())C0(J);else J.style.transform=R(J)}function l6(J,$,Q){let Z=$-J;if(Z>180)Z-=360;if(Z<-180)Z+=360;return J+Z*Q}var BJ=null,o6=100,s6=500,i6=0.5,F0=[],n6=50;function a6(J){for(let $=0;$<F0.length;$++)if(F0[$].length>=J){let Q=F0.splice($,1)[0];return Q.length=J,Q}return Array(J)}function r6(J){if(F0.length<n6)F0.push(J)}class _J{target=null;property="";startValue=0;endValue=0;change=0;unit="";next=null;valueType="scalar";startColor=null;endColor=null;changeColor=new Float32Array(4);startFilters=null;endFilters=null;startDraw=null;endDraw=null;pathLength=0;pathData=null;motionPathLength=0;startProgress=0;endProgress=0;pathRotate=!1;alignOffset=null;pathOffset=null;pathLUT=null;_isElement=!1;init(J,$,Q,Z,j=""){return this.target=J,this.property=$,this.startValue=Q,this.endValue=Z,this.change=Z-Q,this.unit=j,this.valueType="scalar",this._isElement=J instanceof Element,this}initColor(J,$,Q,Z){return this.target=J,this.property=$,this.valueType="color",this.startColor=Q,this.endColor=Z,this.changeColor[0]=Z[0]-Q[0],this.changeColor[1]=Z[1]-Q[1],this.changeColor[2]=Z[2]-Q[2],this.changeColor[3]=Z[3]-Q[3],this._isElement=J instanceof Element,this}initFilter(J,$,Q,Z){return this.target=J,this.property=$,this.valueType="filter",this.startFilters=Q,this.endFilters=Z,this._isElement=J instanceof Element,this}initDrawSVG(J,$,Q,Z,j){return this.target=J,this.property=$,this.valueType="drawSVG",this.startDraw=Q,this.endDraw=Z,this.pathLength=j,this._isElement=J instanceof Element,this}initPath(J,$,Q,Z,j,q,G,z,W){if(J instanceof Element)v(J,!0);this.target=J,this.property=$,this.valueType="path",this.pathData=Q,this.motionPathLength=Z,this.startProgress=j,this.endProgress=q,this.pathRotate=G,this.alignOffset=z,this.pathOffset=W,this._isElement=J instanceof Element;let N=Math.abs(q-j),B=Z*N,_=Math.min(s6,Math.max(o6,Math.ceil(B*i6)));this.pathLUT=a6(_+1);for(let X=0;X<=_;X++){let Y=X/_,H=j+(q-j)*Y;this.pathLUT[X]=ZJ(Q,H,G)}return this}render(J){if(!this.target)return;if(this.valueType==="color"&&this.startColor){let $=this.startColor[0]+this.changeColor[0]*J,Q=this.startColor[1]+this.changeColor[1]*J,Z=this.startColor[2]+this.changeColor[2]*J,j=this.startColor[3]+this.changeColor[3]*J;if(this._isElement)cJ(this.target,this.property,$,Q,Z,j)}else if(this.valueType==="filter"&&this.startFilters&&this.endFilters){if(this._isElement)mJ(this.target,this.startFilters,this.endFilters,J)}else if(this.valueType==="drawSVG"&&this.startDraw&&this.endDraw){if(this._isElement&&this.pathLength>0){let $=this.startDraw.start+(this.endDraw.start-this.startDraw.start)*J,Q=this.startDraw.end+(this.endDraw.end-this.startDraw.end)*J;if(BJ||(BJ=U.drawSVG))BJ.applyDrawSVG(this.target,$,Q,this.pathLength)}}else if(this.valueType==="path"&&this.pathLUT&&this.pathLUT.length>0){if(this._isElement)gJ(this.target,J,{pathLUT:this.pathLUT,alignOffset:this.alignOffset??{x:0,y:0},pathOffset:this.pathOffset??{x:0,y:0},pathRotate:this.pathRotate})}else{let $=this.startValue+this.change*J;if(this._isElement)pJ(this.target,this.property,$,this.unit);else this.target[this.property]=$}}reset(){if(this.target=null,this.property="",this.startValue=0,this.endValue=0,this.change=0,this.unit="",this.next=null,this.valueType="scalar",this.startColor=null,this.endColor=null,this.startFilters=null,this.endFilters=null,this.startDraw=null,this.endDraw=null,this.pathLength=0,this.pathData=null,this.motionPathLength=0,this.startProgress=0,this.endProgress=0,this.pathRotate=!1,this.alignOffset=null,this.pathOffset=null,this.pathLUT)r6(this.pathLUT);this.pathLUT=null,this._isElement=!1}}class O0{pool=[];totalCreated=0;factory;maxSize;constructor(J,$){this.factory=J,this.maxSize=$}acquire(){if(this.pool.length>0)return this.pool.pop();return this.totalCreated++,this.factory()}release(J){if(J.reset(),this.maxSize===void 0||this.pool.length<this.maxSize)this.pool.push(J)}getPoolSize(){return this.pool.length}getTotalCreated(){return this.totalCreated}clear(){this.pool=[]}}var L0=new O0(()=>new _J,500),J0={acquire:()=>L0.acquire(),release:(J)=>L0.release(J),getPoolSize:()=>L0.getPoolSize(),getTotalCreated:()=>L0.getTotalCreated(),clear:()=>L0.clear()};var lJ={x:0,y:0,z:0,rotate:0,rotateX:0,rotateY:0,rotateZ:0,scale:1,scaleX:1,scaleY:1,scaleZ:1,skewX:0,skewY:0,opacity:1};class c{static _createAnimationCallback=null;static setCreateAnimationCallback(J){c._createAnimationCallback=J}_targets;_originalTargets;_fromVars;_toVars;_duration=0.5;_delay=0;_ease="power1.out";_animation=null;_animations=[];_built=!1;_splitType;_mask;_repeat;_repeatDelay;_yoyo;_stagger;_axis;_fitConfig;_onStart;_onUpdate;_onComplete;_onRepeat;_onReverseComplete;_skipInitialFromRender=!1;_plainObjectInitialValues=new Map;_expectedAnimationIds=[];_propsToAnimate=[];constructor(J,$){if(this._targets=D0(J),this._originalTargets=this._targets,$)this._applyAnimationConfig($)}_applyAnimationConfig(J){if(J.from)this._fromVars=J.from;if(J.to)this._toVars=J.to;if(J.duration!==void 0)if(typeof J.duration!=="number"||!isFinite(J.duration)||J.duration<0)console.warn(`[Motion] Invalid duration: ${J.duration}. Must be a finite number >= 0. Using default.`);else this._duration=J.duration;if(J.delay!==void 0)if(typeof J.delay!=="number"||isNaN(J.delay))console.warn(`[Motion] Invalid delay: ${J.delay}. Must be a number. Using default 0.`);else if(!isFinite(J.delay))console.warn(`[Motion] Invalid delay: ${J.delay}. Infinity is not a valid delay. Using default 0.`);else this._delay=J.delay;if(J.ease)this._ease=J.ease;if(J.split)this._splitType=J.split;if(J.mask)this._mask=J.mask;if(J.stagger!==void 0)this._stagger=J.stagger;if(J.axis)this._axis=J.axis;if(J.fit)this._fitConfig=J.fit;if(J.repeat)if(typeof J.repeat==="number")this._repeat=J.repeat;else this._repeat=J.repeat.times,this._repeatDelay=J.repeat.delay,this._yoyo=J.repeat.yoyo;if(J.onStart)this._onStart=J.onStart;if(J.onUpdate)this._onUpdate=J.onUpdate;if(J.onComplete)this._onComplete=J.onComplete;if(J.onRepeat)this._onRepeat=J.onRepeat;if(J.onReverseComplete)this._onReverseComplete=J.onReverseComplete}_capturePlainObjectValues(J){for(let $ of this._targets){if($ instanceof Element)continue;let Q=$,Z={};for(let j of J)if(j in Q&&typeof Q[j]==="number")Z[j]=Q[j];if(Object.keys(Z).length>0)this._plainObjectInitialValues.set($,Z)}}_restorePlainObjectValues(){for(let[J,$]of this._plainObjectInitialValues){let Q=J;for(let[Z,j]of Object.entries($))Q[Z]=j}}_ensureBuilt(){if(!this._built)this._build()}_isInvalidated(){if(this._animations.length===0)return!1;return this._animations.some((J,$)=>{let Q=J.getId(),Z=this._expectedAnimationIds[$];return Q===0||Q!==Z})}rebuildIfPooled(){if(this._isInvalidated()){this._restorePlainObjectValues();for(let J of this._targets)if(J instanceof Element)v(J),U.styleReset?.clearAnimationStylesForProps?.(J,this._propsToAnimate);this._resetBuildState(),this._ensureBuilt()}}_build(){if(this._built)return;if(this._targets.length===0)return;if(!this._fromVars&&!this._toVars&&!this._fitConfig&&this._duration<=0)return;if(this._fitConfig){if(!U.fit){console.warn("[Motion] FitResolver not loaded. Did you import the SDK?");return}if(this._built=!0,!c._createAnimationCallback)throw Error("AnimationBuilder: Engine not initialized. Call Engine.init() first.");let q={};if(this._repeat!==void 0)q.repeat=this._repeat;if(this._repeatDelay!==void 0)q.repeatDelay=this._repeatDelay;if(this._yoyo)q.yoyo=this._yoyo;if(this._onStart)q.onStart=this._onStart;if(this._onUpdate)q.onUpdate=this._onUpdate;if(this._onComplete)q.onComplete=this._onComplete;if(this._onRepeat)q.onRepeat=this._onRepeat;if(this._onReverseComplete)q.onReverseComplete=this._onReverseComplete;if(this._stagger!==void 0)q.stagger=this._stagger;let G=[];for(let W of this._targets){if(!(W instanceof Element))continue;let N=c._createAnimationCallback([W],{},this._duration,this._delay,this._ease,!1,void 0,q);if(Array.isArray(N))G.push(...N);else G.push(N)}let z=this._fitConfig;for(let W of G)for(let N of W.getTargets())if(N instanceof Element)U.fit.registerPendingSetup(W,N,z,J0);this._animation=G[0]??null,this._animations=G,this._expectedAnimationIds=G.map((W)=>W.getId());return}this._built=!0;let J={},$=!1,Q;if(this._fromVars&&this._toVars){J={...this._toVars},Q={...this._fromVars},$=!0;for(let q of Object.keys(Q))if(!(q in J))if(q in lJ)J[q]=lJ[q];else if(q0(q))J[q]="";else if(r(q))J[q]="";else{let G=Q[q];if(G===void 0||G===null)continue;let W=V(G).unit||g(q),N;for(let _ of this._targets)if(_ instanceof Element){if(t(q))try{let Y=window.getComputedStyle(_).getPropertyValue(q).trim();if(Y)N=V(Y).value}catch{}else N=p(_,q);break}let B=N??0;J[q]=W?`${B}${W}`:`${B}`}}else if(this._fromVars)J={...this._fromVars},$=!0;else if(this._toVars)J={...this._toVars};if(this._splitType&&U.textSplitter?.split){let q={mask:!!this._mask,consumer:this},G=[];for(let z of this._originalTargets)if(z instanceof Element){let W=U.textSplitter?.split(z,this._splitType,q);G.push(...W)}if(G.length>0)this._targets=G}if(this._propsToAnimate=Object.keys(J),Q){for(let q of Object.keys(Q))if(!this._propsToAnimate.includes(q))this._propsToAnimate.push(q)}if(this._plainObjectInitialValues.size===0)this._capturePlainObjectValues(this._propsToAnimate);if($){for(let q of this._targets)if(q instanceof Element)v(q),U.styleReset?.clearAnimationStylesForProps?.(q,this._propsToAnimate)}if(U.styleReset?.registerAnimatedProps){for(let q of this._targets)if(q instanceof Element)U.styleReset?.registerAnimatedProps(q,this._propsToAnimate)}let Z={repeat:this._repeat,repeatDelay:this._repeatDelay,yoyo:this._yoyo,stagger:this._stagger,onStart:this._onStart,onUpdate:this._onUpdate,onComplete:this._onComplete,onRepeat:this._onRepeat,onReverseComplete:this._onReverseComplete,_skipInitialRender:this._skipInitialFromRender||void 0};if(!c._createAnimationCallback)throw Error("AnimationBuilder: Engine not initialized. Call AnimationBuilder.setCreateAnimationCallback first.");let j=c._createAnimationCallback(this._targets,J,this._duration,this._delay,this._ease,$,Q,Z);if(Array.isArray(j))this._animations=j,this._animation=j[0]||null;else this._animation=j,this._animations=[j];this._expectedAnimationIds=this._animations.map((q)=>q.getId())}getAnimation(){return this._ensureBuilt(),this._animation}getAnimations(){return this._ensureBuilt(),this._animations}getTargets(){return this._targets}getOriginalTargets(){return this._originalTargets}hasSplit(){return!!this._splitType}_resetBuildState(){this._built=!1,this._animations=[],this._animation=null,this._expectedAnimationIds=[]}getConfig(){return{fromVars:this._fromVars?{...this._fromVars}:void 0,toVars:this._toVars?{...this._toVars}:void 0,duration:this._duration,delay:this._delay,ease:this._ease,axis:this._axis,fit:this._fitConfig?{...this._fitConfig}:void 0,split:this._splitType,mask:this._mask,stagger:this._stagger,repeat:this._repeat,repeatDelay:this._repeatDelay,yoyo:this._yoyo,onStart:this._onStart,onUpdate:this._onUpdate,onComplete:this._onComplete,onRepeat:this._onRepeat,onReverseComplete:this._onReverseComplete}}setAxis(J){this._axis=J}getAxis(){return this._axis}setSkipInitialFromRender(J){this._skipInitialFromRender=J}}class S0{static parse(J,$,Q,Z){if(J===void 0)return $;if(typeof J==="number")return J;let j=J.trim();if(j==="<")return Q;if(j===">")return Z;if(j.startsWith("<")){let q=parseFloat(j.substring(1));if(!isNaN(q))return Q+q}if(j.startsWith(">")){let q=parseFloat(j.substring(1));if(!isNaN(q))return Z+q}if(j.startsWith("+=")){let q=parseFloat(j.substring(2));return $+q}if(j.startsWith("-=")){let q=parseFloat(j.substring(2));return $-q}return console.warn(`Invalid position parameter: "${j}", using current end`),$}}class b{static _eachCounter=0;static _registerWithEngine=null;static setEngineRegisterCallback(J){b._registerWithEngine=J}_name;_children=[];_duration=0;_time=0;_progress=0;_timeScale=1;_isActive=!1;_isReversed=!1;_killed=!1;_atZeroState=!1;_repeat=0;_repeatDelay=0;_yoyo=!1;_currentRepeat=0;_completeFired=!1;_inRepeatDelay=!1;_repeatDelayCounter=0;_onStart;_onUpdate;_onComplete;_onRepeat;_startFired=!1;_trigger;_unregisterCallback;setUnregisterCallback(J){this._unregisterCallback=J}_previousStart=0;_previousEnd=0;_eachInstances;_eachDuration;_initialValues=new Map;_initialTransforms=new Map;_transformElements=new Set;_savedTransitions=new Map;_transitionsDisabled=!1;_savedWillChange=new Map;_willChangeApplied=!1;_splitParentOverrides=new Map;constructor(J,$){if(this._name=J,$?.repeat!==void 0)if(typeof $.repeat==="number")this._repeat=$.repeat;else this._repeat=$.repeat.times,this._repeatDelay=$.repeat.delay??0,this._yoyo=$.repeat.yoyo??!1;if($?.onStart)this._onStart=$.onStart;if($?.onUpdate)this._onUpdate=$.onUpdate;if($?.onComplete)this._onComplete=$.onComplete;if($?.onRepeat)this._onRepeat=$.onRepeat;if(J&&b._registerWithEngine)b._registerWithEngine(J,this)}duration(){if(this._eachDuration!==void 0)return this._eachDuration;return this._duration}totalDuration(){if(this._repeat===-1)return 1/0;return this._duration*(this._repeat+1)+this._repeatDelay*this._repeat}clear(){for(let J of this._children)if(J.type==="animation")J.child.kill();else if(J.type==="timeline")J.child.kill();return this._children=[],this._duration=0,this._time=0,this._progress=0,this._isActive=!1,this._isReversed=!1,this._startFired=!1,this._previousStart=0,this._previousEnd=0,this._initialValues.clear(),this._initialTransforms.clear(),this._transformElements.clear(),this._splitParentOverrides.clear(),this._clearTransitionData(),this._currentRepeat=0,this._completeFired=!1,this._inRepeatDelay=!1,this._repeatDelayCounter=0,this}_captureInitialValues(J){let $=J.getTargets(),Q=J.getFirstPropTween();while(Q){let Z=Q.property;for(let j of $){if(!(j instanceof Element))continue;let q=this._initialValues.get(j);if(!q)q=new Map,this._initialValues.set(j,q);if(!q.has(Z)){let G=j;if(h(Z)||qJ(Z)){if(this._transformElements.add(j),!this._initialTransforms.has(j)){let z=G.style.transform;this._initialTransforms.set(j,z||null)}q.set(Z,{removeInline:!0})}else if(q0(Z)||r(Z))q.set(Z,{removeInline:!0});else{let z=Z.replace(/([A-Z])/g,"-$1").toLowerCase();if(G.style.getPropertyValue(z)!==""){let N=yJ(j,Z);q.set(Z,{removeInline:!1,value:N.value,unit:N.unit})}else q.set(Z,{removeInline:!0})}}}Q=Q.next}}_restoreInitialValues(){for(let J of this._transformElements){let $=J;v(J);let Q=this._initialTransforms.get(J);if(Q)$.style.transform=Q;else $.style.removeProperty("transform")}for(let[J,$]of this._initialValues){let Q=J;for(let[Z,j]of $){if(h(Z))continue;let q=Z.replace(/([A-Z])/g,"-$1").toLowerCase();if(j.removeInline)Q.style.removeProperty(q);else{let G=`${j.value}${j.unit}`;Q.style.setProperty(q,G)}}}}_disableTransitions(){if(this._transitionsDisabled)return;for(let J of this._savedTransitions.keys())J.style.transition="none";this._transitionsDisabled=!0}_applyWillChange(){if(this._willChangeApplied)return;for(let J of this._savedWillChange.keys())J.style.willChange="transform";this._willChangeApplied=!0}_restoreTransitions(){if(!this._transitionsDisabled)return;for(let[J,$]of this._savedTransitions)J.style.transition=$;this._transitionsDisabled=!1}_clearTransitionData(){this._restoreTransitions(),this._savedTransitions.clear(),this._transitionsDisabled=!1,this._restoreWillChange()}_restoreWillChange(){if(this._willChangeApplied)for(let[J,$]of this._savedWillChange)if($)J.style.willChange=$;else J.style.removeProperty("will-change");this._savedWillChange.clear(),this._willChangeApplied=!1}_addEntry(J,$,Q){let Z=S0.parse(Q,this._duration,this._previousStart,this._previousEnd),j=new c(J,$);return this._addBuilder(j,Z)}_addBuilder(J,$){J.setSkipInitialFromRender(!0);let Q=J.getAnimations();if(Q.length===0)return this;let Z=$;for(let j of Q){let q=j.getDelay(),G=$+q;j.clearDelay();let z=j.totalDuration(),W={type:"animation",child:j,builder:J,startTime:G,duration:z};this._children.push(W),j.setTimelineChild(!0),j.pause(),this._captureInitialValues(j);for(let _ of j.getTargets())if(_ instanceof HTMLElement&&!this._savedTransitions.has(_))this._savedTransitions.set(_,_.style.transition);for(let _ of j.getTargets())if(_ instanceof HTMLElement&&this._transformElements.has(_)&&!this._savedWillChange.has(_))this._savedWillChange.set(_,_.style.willChange);let N=!!J.getConfig().fromVars;if(G>0&&!N)j.setLazyStartCapture(!0);if(N)j.renderAtTime(0);if(J.hasSplit()){for(let _ of J.getOriginalTargets())if(_ instanceof Element){let X=_;if(!this._splitParentOverrides.has(X))this._splitParentOverrides.set(X,X.style.opacity);X.style.opacity="1"}}let B=G+z;if(B>Z)Z=B}if(this._previousStart=$,this._previousEnd=Z,Z>this._duration)this._duration=Z;return this}call(J,$,Q){let Z=S0.parse(Q,this._duration,this._previousStart,this._previousEnd),j={type:"callback",child:J,startTime:Z,duration:0,params:$};if(this._children.push(j),this._previousStart=Z,this._previousEnd=Z,Z>this._duration)this._duration=Z;return this}_getFirstAnimationTarget(){let J=this._children[0];if(J?.type==="animation"&&J.builder){let Q=J.builder,Z=Q.hasSplit()?Q.getOriginalTargets():Q.getTargets();for(let j of Z)if(U0(j))return j}let $=this.getFirstChildAnimation();if($){let Q=$.getTargets();for(let Z of Q)if(U0(Z))return Z}return}_getAllAnimationTargets(){let J=[],$=new Set,Q=new Set;for(let Z of this._children)if(Z.type==="animation"&&Z.builder){if(Q.has(Z.builder))continue;Q.add(Z.builder);let j=Z.builder.hasSplit()?Z.builder.getOriginalTargets():Z.builder.getTargets();for(let q of j)if(U0(q)&&!$.has(q))$.add(q),J.push(q)}return J}_createInstanceForElement(J,$){let Z=`${this._name||"__each"}__each_${$}_${b._eachCounter++}`,j=new b(Z),q=new Set;for(let G of this._children)if(G.type==="animation"&&G.builder){if(q.has(G.builder))continue;if(q.add(G.builder),!(G.builder.hasSplit()?G.builder.getOriginalTargets():G.builder.getTargets()).filter((X)=>U0(X)).includes(J))continue;let W=G.builder.getConfig(),N=W.repeat!=null?{times:W.repeat,delay:W.repeatDelay,yoyo:W.yoyo}:void 0,B=G.builder.hasSplit(),_=new c(J,{from:W.fromVars,to:W.toVars,duration:W.duration,delay:W.delay,ease:W.ease,repeat:N,...B&&W.split?{split:W.split}:{},...B&&W.mask?{mask:W.mask}:{},...B&&W.stagger!==void 0?{stagger:W.stagger}:{},onStart:W.onStart,onUpdate:W.onUpdate,onComplete:W.onComplete,onRepeat:W.onRepeat,onReverseComplete:W.onReverseComplete});if(W.axis)_.setAxis(W.axis);j._addBuilder(_,G.startTime)}else if(G.type==="callback")j.call(G.child,G.params,G.startTime);return j}_createInstanceForElements(J,$){let Z=`${this._name||"__each"}__each_${$}_${b._eachCounter++}`,j=new b(Z),q=new Set;for(let G of this._children)if(G.type==="animation"&&G.builder){if(q.has(G.builder))continue;q.add(G.builder);let z=G.builder.getConfig(),W=z.repeat!=null?{times:z.repeat,delay:z.repeatDelay,yoyo:z.yoyo}:void 0,N=G.builder.hasSplit(),B=new c(J,{from:z.fromVars,to:z.toVars,duration:z.duration,delay:z.delay,ease:z.ease,repeat:W,...N&&z.split?{split:z.split}:{},...N&&z.mask?{mask:z.mask}:{},...N&&z.stagger!==void 0?{stagger:z.stagger}:{},onStart:z.onStart,onUpdate:z.onUpdate,onComplete:z.onComplete,onRepeat:z.onRepeat,onReverseComplete:z.onReverseComplete});if(z.axis)B.setAxis(z.axis);j._addBuilder(B,G.startTime)}else if(G.type==="callback")j.call(G.child,G.params,G.startTime);return j}_resolveTargetElements(J){if(typeof J!=="string")return[J];if(typeof document<"u")try{return Array.from(document.querySelectorAll(J))}catch($){console.warn(`[Motion] Invalid selector "${J}":`,$)}return[]}_setupEachModeGeneric(J,$){if(J.length===0)return;this._eachInstances=[];let Q=this._children.filter((Z)=>Z.type==="animation"&&Z.builder?.hasSplit()).map((Z)=>Z.builder);if(Q.length>0)for(let Z of J)for(let j of Q)U.textSplitter?.revert?.(Z,j);this._clearTransitionData();for(let Z=0;Z<J.length;Z++){let j=J[Z],q=this._createInstanceForElement(j,Z);$(q,j),this._eachInstances.push(q)}{let Z=null,j=this._onUpdate,q=this._onStart,G=this._onComplete;for(let z of this._eachInstances){if(j)z.onUpdate((W,N)=>{let B=W>0&&W<1;if(B)Z=z;if(Z===z){if(j(W,N),!B)Z=null}});if(q)z.onStart(()=>{Z=z,q()});if(G)z.onComplete(()=>{if(Z===z)Z=null,G()})}}this._eachDuration=this._duration;for(let Z of this._children)if(Z.type==="animation"){let j=Z.child;j.setTimelineChild(!1),j.kill()}else if(Z.type==="timeline")Z.child.kill();this._children=[],this._duration=0,this._initialValues.clear(),this._initialTransforms.clear(),this._transformElements.clear(),this._splitParentOverrides.clear(),this._isActive=!1,this._time=0,this._progress=0,this._isReversed=!1,this._startFired=!1}_setupEachMode(J,$){let Q=U.triggerManager?.getInstance?.();if(!Q)return;let{each:Z,...j}=$;if($.target){let G=this._resolveTargetElements($.target);if(G.length===0)return;let z=this._getAllAnimationTargets();if(!z.every((B)=>G.some((_)=>_!==B&&_.contains(B)))){let B=this._children.filter((_)=>_.type==="animation"&&_.builder?.hasSplit()).map((_)=>_.builder);if(B.length>0)for(let _ of z)for(let X of B)U.textSplitter?.revert?.(_,X);this._setupEachModeGeneric(z,(_,X)=>{if(J==="scroll")Q.registerScroll(_,{...j,target:X});else if(J==="hover")Q.registerHover(_,{...j,target:X});else Q.registerClick(_,{...j,target:X})});return}let N=this._children.filter((B)=>B.type==="animation"&&B.builder?.hasSplit()).map((B)=>B.builder);if(N.length>0)for(let B of z)for(let _ of N)U.textSplitter?.revert?.(B,_);this._clearTransitionData(),this._eachInstances=[];for(let B=0;B<G.length;B++){let _=G[B],X=z.filter((H)=>_.contains(H));if(X.length===0)continue;let Y=this._createInstanceForElements(X,B);if(J==="scroll")Q.registerScroll(Y,{...j,target:_});else if(J==="hover")Q.registerHover(Y,{...j,target:_});else Q.registerClick(Y,{...j,target:_});this._eachInstances.push(Y)}{let B=null,_=this._onUpdate,X=this._onStart,Y=this._onComplete;for(let H of this._eachInstances){if(_)H.onUpdate((I,K)=>{let F=I>0&&I<1;if(F)B=H;if(B===H){if(_(I,K),!F)B=null}});if(X)H.onStart(()=>{B=H,X()});if(Y)H.onComplete(()=>{if(B===H)B=null,Y()})}}this._eachDuration=this._duration;for(let B of this._children)if(B.type==="animation"){let _=B.child;_.setTimelineChild(!1),_.kill()}else if(B.type==="timeline")B.child.kill();this._children=[],this._duration=0,this._initialValues.clear(),this._initialTransforms.clear(),this._transformElements.clear(),this._splitParentOverrides.clear(),this._isActive=!1,this._time=0,this._progress=0,this._isReversed=!1,this._startFired=!1;return}let q=this._getAllAnimationTargets();this._setupEachModeGeneric(q,(G,z)=>{if(J==="scroll")Q.registerScroll(G,{...j,target:z});else if(J==="hover")Q.registerHover(G,{...j,target:z});else Q.registerClick(G,{...j,target:z})})}onHover(J){if(J?.each)return this._setupEachMode("hover",J),this;let $=J?.target??this._getFirstAnimationTarget();return U.triggerManager?.getInstance?.().registerHover(this,{target:$,onLeave:J?.onLeave,leaveDelay:J?.leaveDelay}),this}onClick(J){if(J?.each)return this._setupEachMode("click",J),this;let $=J?.target??this._getFirstAnimationTarget();return U.triggerManager?.getInstance?.().registerClick(this,{target:$,secondTarget:J?.secondTarget,toggle:J?.toggle,preventDefault:J?.preventDefault}),this}onScroll(J){if(J?.each)return this._setupEachMode("scroll",J),this;let $=J?.target??this._getFirstAnimationTarget();return U.triggerManager?.getInstance?.().registerScroll(this,{...J,target:$}),this}onMouseMove(J){if(J?.each&&J.target)return this._setupMouseMoveEachMode(J),this;return U.triggerManager?.getInstance?.().registerMouseMove(this,{type:J?.type??"distance",target:J?.target,smooth:J?.smooth,startProgress:J?.startProgress,leaveProgress:J?.leaveProgress}),this}_setupMouseMoveEachMode(J){if(!J.target)return;let $=[];if(typeof J.target==="string"){if(typeof document<"u")$=Array.from(document.querySelectorAll(J.target))}else $=[J.target];let Q=U.triggerManager?.getInstance?.();if(!Q)return;this._setupEachModeGeneric($,(Z,j)=>{Q.registerMouseMove(Z,{type:J.type??"distance",target:j,smooth:J.smooth,startProgress:J.startProgress,leaveProgress:J.leaveProgress})})}onPageLoad(J){return U.triggerManager?.getInstance?.().registerPageLoad(this,J||{}),this}onPageExit(J){return U.triggerManager?.getInstance?.().registerPageExit(this,J||{}),this}onGesture(J){if(J.each)return this._setupGestureEachMode(J),this;return U.triggerManager?.getInstance?.().registerGesture(this,J),this}_setupGestureEachMode(J){let $=[];if(J.target)if(typeof J.target==="string"){if(typeof document<"u")$=Array.from(document.querySelectorAll(J.target))}else $=[J.target];else $=this._getAllAnimationTargets();if(this._setupEachModeGeneric($,()=>{}),!this._eachInstances||this._eachInstances.length===0)return;let Q=U.triggerManager?.getInstance?.();if(!Q)return;for(let Z=0;Z<$.length;Z++){let j=$[Z],q=this._eachInstances[Z];Q.registerGesture(q,{...J,target:j,each:!1,_siblings:this._eachInstances,_index:Z})}}onCursor(J){return U.triggerManager?.getInstance?.().registerCursor(this,J),this}_updateCallbackChild(J,$,Q){let Z=J.startTime,j=$<Z&&this._time>=Z,q=$>Z&&this._time<=Z,G=Math.abs(this._time-Z)<0.001;if(j||q||G&&Q===0){let z=J.child,W=J.params||[];z(...W)}}_updateAnimationChild(J,$){let Q=J.child,Z=Math.abs(Q.getTimeScale())||1,j=Q.totalDuration()/Z,q=this._time-J.startTime,G=q*Z;if(q>=0&&q<=j){if(!Q.isActive())Q.captureStartValues(),Q.play();Q.renderAtTime(G)}else if(q<0){if(!Q.isLazyCapture())Q.renderAtTime(0);if(Q.isActive())Q.pause(),Q.fireReverseComplete()}else if(Q.isActive())Q.renderAtTime(Q.totalDuration()),Q.pause();else if($===0)Q.renderAtTime(Q.totalDuration())}_updateTimelineChild(J,$){let Q=J.child,Z=Q.duration(),j=this._time-J.startTime;if(j>=0&&j<=Z){if(!Q.isActive())Q.play();Q.time(j)}else if(Q.isActive())if(j<0)Q.time(0),Q.pause();else Q.time(Z),Q.pause();else if($===0)if(j<0);else Q.time(Z)}update(J){if(this._eachInstances){for(let Z of this._eachInstances)Z.update(J);return}let $=this._time;if(!this._isActive&&J===0);else if(!this._isActive)return;let Q=J*this._timeScale;if(this._inRepeatDelay&&J>0){if(this._repeatDelayCounter-=Q,this._repeatDelayCounter>0)return;if(this._inRepeatDelay=!1,this._repeatDelayCounter=0,this._isReversed){this._time=this._duration;for(let Z of this._children)if(Z.type==="animation")Z.child.resetForReplay()}else this._time=0,this._startFired=!1,this._resetChildrenForCycle()}else if(!this._inRepeatDelay){if(this._time+=this._isReversed?-Q:Q,J>0){if(!this._isReversed&&this._time>=this._duration&&this._repeat!==0){if(this._repeat===-1||this._currentRepeat<this._repeat){this._time=this._duration,this._currentRepeat++;try{this._onRepeat?.(this._currentRepeat)}catch(j){console.error("[Motion] onRepeat callback error:",j)}if(this._yoyo){this._isReversed=!0;for(let j of this._children)if(j.type==="animation")j.child.resetForReplay()}else this._time=0,this._startFired=!1,this._resetChildrenForCycle();if(this._repeatDelay>0)this._inRepeatDelay=!0,this._repeatDelayCounter=this._repeatDelay}}else if(this._isReversed&&this._time<=0&&this._yoyo&&this._repeat!==0){if(this._repeat===-1||this._currentRepeat<this._repeat){this._time=0,this._currentRepeat++;try{this._onRepeat?.(this._currentRepeat)}catch(j){console.error("[Motion] onRepeat callback error:",j)}if(this._isReversed=!1,this._startFired=!1,this._resetChildrenForCycle(),this._repeatDelay>0)this._inRepeatDelay=!0,this._repeatDelayCounter=this._repeatDelay}}}}if(this._time<0)this._time=0;else if(this._time>this._duration)this._time=this._duration;if(this._progress=this._duration>0?this._time/this._duration:0,!this._startFired&&this._isActive&&this._time>0)this._startFired=!0,this._disableTransitions(),this._applyWillChange(),this._onStart?.();if(this._isActive)this._onUpdate?.(this._progress,this._time);for(let Z of this._children)if(Z.type==="callback")this._updateCallbackChild(Z,$,J);else if(Z.type==="animation")this._updateAnimationChild(Z,J);else if(Z.type==="timeline")this._updateTimelineChild(Z,J);if(!this._completeFired){let Z=!this._isReversed&&this._time>=this._duration,j=this._isReversed&&this._time<=0,q=this._repeat!==-1&&this._currentRepeat>=this._repeat;if(Z&&(this._repeat===0||q))this._completeFired=!0,this._isActive=!1,this._startFired=!1,this._restoreTransitions(),this._onComplete?.();else if(j&&(this._repeat===0||this._yoyo&&q))this._completeFired=!0,this._isActive=!1,this._startFired=!1,this._restoreTransitions(),this._onComplete?.()}}play(J){if(this._killed)return console.warn("[Motion] Cannot play a killed timeline. Create a new one with Motion(name)."),this;if(this._eachInstances){for(let $ of this._eachInstances)$.play(J);return this}if(J!==void 0){if(this._time=J,this._progress=this._duration>0?this._time/this._duration:0,J===0)this._currentRepeat=0,this._inRepeatDelay=!1,this._repeatDelayCounter=0}else if(this._time>=this._duration&&!this._isReversed)return this;return this._completeFired=!1,this._isReversed=!1,this._isActive=!0,this._atZeroState=!1,this}pause(J){if(this._killed)return console.warn("[Motion] Cannot pause a killed timeline. Create a new one with Motion(name)."),this;if(this._eachInstances){for(let $ of this._eachInstances)$.pause(J);return this}if(J!==void 0)this._time=J,this._progress=this._duration>0?this._time/this._duration:0;this._isActive=!1;for(let $ of this._children)if($.type!=="callback"){let Q=$.child;if("pause"in Q)Q.pause()}return this}reverse(J){if(this._killed)return console.warn("[Motion] Cannot reverse a killed timeline. Create a new one with Motion(name)."),this;if(this._eachInstances){for(let $ of this._eachInstances)$.reverse(J);return this}if(J!==void 0)this._time=J,this._progress=this._duration>0?this._time/this._duration:0;else if(this._time<=0&&this._isReversed)return this;return this._completeFired=!1,this._inRepeatDelay=!1,this._repeatDelayCounter=0,this._isReversed=!0,this._isActive=!0,this._atZeroState=!1,this}restart(){if(this._killed)return console.warn("[Motion] Cannot restart a killed timeline. Create a new one with Motion(name)."),this;if(this._eachInstances){for(let J of this._eachInstances)J.restart();return this}this._time=0,this._progress=0,this._isActive=!0,this._isReversed=!1,this._startFired=!1,this._atZeroState=!1,this._currentRepeat=0,this._completeFired=!1,this._inRepeatDelay=!1,this._repeatDelayCounter=0;for(let J of this._children)if(J.type==="animation")J.child.resetForReplay();return this._restoreInitialValues(),this._renderPositionZeroAnimations(),this}_resetChildrenForCycle(){for(let J of this._children)if(J.type==="animation")J.child.resetForReplay();this._restoreInitialValues(),this._renderPositionZeroAnimations()}_renderPositionZeroAnimations(){for(let J of this._children)if(J.type==="animation"){let $=J.child;if(!$.isLazyCapture())$.renderAtTime(0);if($.isActive())$.pause()}else if(J.type==="timeline")J.child.progress(0)}seek(J){if(this._killed)return console.warn("[Motion] Cannot seek a killed timeline. Create a new one with Motion(name)."),this;if(this._eachInstances){for(let $ of this._eachInstances)$.seek(J);return this}return this._time=Math.max(0,Math.min(J,this._duration)),this._progress=this._duration>0?this._time/this._duration:0,this._atZeroState=!1,this.update(0),this}setAxisProgress(J,$){let Q=Math.max(0,Math.min(1,$));for(let Z of this._children)if(Z.type==="animation"&&Z.builder){if(Z.builder.getConfig().axis===J){let q=Z.child,G=q.totalDuration();if(!q.isActive())q.captureStartValues(),q.play();q.renderAtTime(Q*G)}}return this}onStart(J){return this._onStart=J,this}onUpdate(J){return this._onUpdate=J,this}onComplete(J){return this._onComplete=J,this}onRepeat(J){return this._onRepeat=J,this}withRepeat(J){if(typeof J==="number")this._repeat=J,this._repeatDelay=0,this._yoyo=!1;else this._repeat=J.times,this._repeatDelay=J.delay??0,this._yoyo=J.yoyo??!1;return this}progress(J){if(J===void 0){if(this._eachInstances&&this._eachInstances.length>0){let Q=0;for(let Z of this._eachInstances){let j=Z.progress();if(j>Q)Q=j}return Q}return this._progress}if(this._eachInstances){for(let Q of this._eachInstances)Q.progress(J);return this}let $=Math.max(0,Math.min(1,J));if(!this._transitionsDisabled&&this._savedTransitions.size>0)this._disableTransitions(),this._applyWillChange();if($===0){for(let Q of this._children)if(Q.type==="animation")Q.child.resetForReplay()}if(this._time=$*this._duration,this._progress=$,$===0)if(this._atZeroState);else this._restoreInitialValues(),this._renderPositionZeroAnimations(),this._atZeroState=!0;else this._atZeroState=!1,this.update(0);return this._onUpdate?.(this._progress,this._time),this}time(J){if(J===void 0){if(this._eachInstances&&this._eachInstances.length>0){let $=0;for(let Q of this._eachInstances){let Z=Q.time();if(Z>$)$=Z}return $}return this._time}if(this._eachInstances){for(let $ of this._eachInstances)$.time(J);return this}return this._time=Math.max(0,Math.min(J,this._duration)),this._progress=this._duration>0?this._time/this._duration:0,this.update(0),this}timeScale(J){if(J===void 0)return this._timeScale;return this._timeScale=J,this}kill(J=!0){if(this._killed=!0,this._isActive=!1,this._atZeroState=!1,U.triggerManager?.getInstance?.().unregister(this),this._eachInstances){for(let $ of this._eachInstances)$.kill(J);this._eachInstances=void 0}if(this._clearTransitionData(),J&&(this._initialValues.size>0||this._transformElements.size>0))this._restoreInitialValues();if(J&&this._splitParentOverrides.size>0){for(let[$,Q]of this._splitParentOverrides)if(Q)$.style.opacity=Q;else $.style.removeProperty("opacity");this._splitParentOverrides.clear()}for(let $ of this._children)if($.type==="animation"){let Q=$.child;Q.setTimelineChild(!1),Q.kill()}else if($.type==="timeline")$.child.kill(J);if(this._unregisterCallback)this._unregisterCallback(),this._unregisterCallback=void 0;this._children=[],this._initialValues.clear(),this._initialTransforms.clear(),this._transformElements.clear(),this._savedTransitions.clear(),this._savedWillChange.clear(),this._splitParentOverrides.clear(),this._willChangeApplied=!1,this._transitionsDisabled=!1,this._duration=0,this._time=0,this._progress=0,this._previousStart=0,this._previousEnd=0,this._isReversed=!1,this._startFired=!1,this._currentRepeat=0,this._completeFired=!1,this._inRepeatDelay=!1,this._repeatDelayCounter=0}isActive(){if(this._eachInstances)return this._eachInstances.some((J)=>J.isActive());return this._isActive}reversed(){if(this._eachInstances)return this._eachInstances.some((J)=>J.reversed());return this._isReversed}getName(){return this._name}getFirstChildAnimation(){let J=this._children[0];if(J?.type==="animation")return J.child;return null}getFirstChildBuilder(){let J=this._children[0];if(J?.type==="animation"&&J.builder)return J.builder;return null}}function y0(J,$,Q){let Z=J;if(h($)){let G=Q??($.startsWith("scale")?"":"px");return(z)=>{y(J,$,z,G),Z.style.transform=R(J)}}if($.startsWith("--")){let G=Q??"";return(z)=>{Z.style.setProperty($,`${z}${G}`)}}let j=$.replace(/([A-Z])/g,"-$1").toLowerCase(),q=Q??"";return(G)=>{Z.style.setProperty(j,`${G}${q}`)}}var t6=new Set(["opacity","z-index","font-weight","line-height","flex","flex-grow","flex-shrink","order","scale","column-count","columns","tab-size","orphans","widows","zoom"]);function e6(J){if(typeof location>"u")return!J.includes(":");try{let $=new URL(J,location.href);return $.protocol==="https:"||$.protocol==="http:"}catch{return!J.includes(":")}}class _0 extends u{_element=null;_innerElement=null;_mousePos={x:-100,y:-100};_cursorPos={x:-100,y:-100};_xSetter=null;_ySetter=null;_squeezeSetter=null;_squeezeConfig={min:0.55,max:1.2,multiplier:150};_state="default";_stateTimelines=new Map;_parsedStates=new Map;_textElement=null;_mediaElement=null;_tickerCallback;_boundMouseMove;_boundMouseDown;_boundMouseUp;_hoverSelectors=null;_isHoveringCursorTarget=!1;_boundHoverTargetMoveHandler=null;_cursorStyleTag=null;_attributeListeners=new Map;constructor(J,$){super(J,$);if(this._config={type:"basic",smooth:0.25,hideNative:!1,...$},$.squeeze===!0)this._squeezeConfig={min:0.55,max:1.2,multiplier:150};else if(typeof $.squeeze==="object")this._squeezeConfig={min:$.squeeze.min??0.55,max:$.squeeze.max??1.2,multiplier:$.squeeze.multiplier??150};if(this._parsedStates.set("default",this._parseStateConfig($.default)),$.hover)this._parsedStates.set("hover",this._parseStateConfig($.hover));if($.click)this._parsedStates.set("click",this._parseStateConfig($.click))}_parseStateConfig(J){let{targets:$,duration:Q,ease:Z,enabled:j,...q}=J;return{properties:q,duration:Q??0.15,ease:Z??"power3.inOut",targets:$,enabled:j??!0}}_onEnable(){if(this._element=this._createContainer(),this._innerElement=document.createElement("div"),this._innerElement.setAttribute("data-cursor-inner",""),this._innerElement.style.cssText="pointer-events:none;position:absolute;top:0;left:0;",this._element.appendChild(this._innerElement),y(this._innerElement,"x",-50,"%"),y(this._innerElement,"y",-50,"%"),this._xSetter=y0(this._element,"x","px"),this._ySetter=y0(this._element,"y","px"),this._config.squeeze)this._squeezeSetter=y0(this._element,"scale");if(this._cursorPos={x:-100,y:-100},this._mousePos={x:-100,y:-100},this._xSetter(-100),this._ySetter(-100),this._applyProperties(this._parsedStates.get("default").properties),this._innerElement.style.transform=R(this._innerElement),this._config.hideNative)this._cursorStyleTag=document.createElement("style"),this._cursorStyleTag.setAttribute("data-cursor-hide",""),this._cursorStyleTag.textContent="* { cursor: none !important; }",document.head.appendChild(this._cursorStyleTag);if(this._config.type==="text")this._setupTextCursor();else if(this._config.type==="media")this._setupMediaCursor();this._createStateTimelines(),this._setupEventListeners(),this._tickerCallback=(J)=>this._tick(J),C.getInstance().add(this._tickerCallback)}_onDisable(){if(this._tickerCallback)C.getInstance().remove(this._tickerCallback),this._tickerCallback=void 0;if(this._cursorStyleTag)this._cursorStyleTag.remove(),this._cursorStyleTag=null;if(this._removeEventListeners(),this._stateTimelines.forEach((J)=>J.kill()),this._stateTimelines.clear(),this._innerElement?.parentNode)this._innerElement.remove();if(this._innerElement=null,this._element?.parentNode)this._element.remove();this._element=null}_createContainer(){let J=document.createElement("div");return J.setAttribute("data-cursor-container",""),J.style.cssText="position:fixed;top:0;left:0;pointer-events:none;z-index:999999;width:0;height:0;",document.body.appendChild(J),J}_applyProperties(J){if(!this._innerElement)return;for(let[$,Q]of Object.entries(J))if($==="transform"){let Z=_0._expandTransformShorthand(String(Q));for(let[j,q]of Object.entries(Z))y(this._innerElement,j,q)}else if(h($)){let Z=typeof Q==="number"?{value:Q,unit:g($)}:V(Q);y(this._innerElement,$,Z.value,Z.unit||g($)||void 0)}else{let Z=n($),j=typeof Q==="number"&&!t6.has(Z)?`${Q}px`:String(Q);this._innerElement.style.setProperty(Z,j)}}_createStateTimelines(){if(!this._innerElement)return;let J=this._parsedStates.get("hover");if(J&&J.enabled){let Q=new b;Q._addEntry(this._innerElement,{to:_0._expandStateProperties(J.properties),duration:J.duration,ease:J.ease}),this._stateTimelines.set("hover",Q)}let $=this._parsedStates.get("click");if($&&$.enabled){let Q=new b;Q._addEntry(this._innerElement,{to:_0._expandStateProperties($.properties),duration:$.duration,ease:$.ease}),this._stateTimelines.set("click",Q)}}static _expandStateProperties(J){let $={};for(let[Q,Z]of Object.entries(J))if(Q==="transform"){let j=_0._expandTransformShorthand(String(Z));Object.assign($,j)}else $[Q]=Z;return $}static _expandTransformShorthand(J){let $={},Q=/([a-zA-Z0-9]+)\(([^)]+)\)/g,Z;while((Z=Q.exec(J))!==null){let j=Z[1],q=Z[2].split(",").map((G)=>parseFloat(G.trim()));switch(j){case"scale":{let G=q[0]??1,z=q.length>1?q[1]:G;if(G===z)$.scale=G;else $.scaleX=G,$.scaleY=z;break}case"scaleX":$.scaleX=q[0]??1;break;case"scaleY":$.scaleY=q[0]??1;break;case"scaleZ":$.scaleZ=q[0]??1;break;case"rotate":$.rotate=q[0]??0;break;case"rotateX":$.rotateX=q[0]??0;break;case"rotateY":$.rotateY=q[0]??0;break;case"rotateZ":$.rotateZ=q[0]??0;break;case"skewX":$.skewX=q[0]??0;break;case"skewY":$.skewY=q[0]??0;break}}return $}_setupEventListeners(){if(this._boundMouseMove=(Q)=>{this._mousePos.x=Q.clientX,this._mousePos.y=Q.clientY},document.addEventListener("mousemove",this._boundMouseMove),this._parsedStates.get("click")?.enabled)this._boundMouseDown=()=>this._setState("click"),this._boundMouseUp=()=>this._setState(this._state==="click"?"default":this._state),document.addEventListener("mousedown",this._boundMouseDown),document.addEventListener("mouseup",this._boundMouseUp);let $=this._parsedStates.get("hover");if($?.enabled&&$.targets&&$.targets.length>0)this._setupHoverTargets($.targets)}_setupHoverTargets(J){this._hoverSelectors=J,this._boundHoverTargetMoveHandler=($)=>{let Z=document.elementsFromPoint($.clientX,$.clientY).some((j)=>this._hoverSelectors.some((q)=>{try{return j.matches(q)}catch{return!1}}));if(Z&&!this._isHoveringCursorTarget)this._isHoveringCursorTarget=!0,this._setState("hover");else if(!Z&&this._isHoveringCursorTarget){if(this._isHoveringCursorTarget=!1,this._state==="hover")this._setState("default")}},window.addEventListener("mousemove",this._boundHoverTargetMoveHandler)}_setupTextCursor(){if(!this._innerElement)return;this._innerElement.style.display="grid",this._innerElement.style.placeItems="center",this._innerElement.style.overflow="visible",this._textElement=document.createElement("div"),this._textElement.setAttribute("data-cursor-text",""),this._textElement.style.whiteSpace="nowrap",this._textElement.style.opacity="0",this._innerElement.appendChild(this._textElement);let $=this._parsedStates.get("hover")?.duration??0.15;if(this._textElement.style.transition=`opacity ${$}s ease-in-out`,this._config.text)for(let[Z,j]of Object.entries(this._config.text))this._textElement.style.setProperty(n(Z),String(j));let Q=document.querySelectorAll("[mp-cursor-text], [mp-cursor-tooltip]");for(let Z of Q){let j=(G)=>{let z=G.target,W=z.getAttribute("mp-cursor-text")??z.getAttribute("mp-cursor-tooltip")??"";if(this._textElement)this._textElement.textContent=W,this._textElement.style.opacity="1";this._setState("hover")},q=()=>{if(this._textElement)this._textElement.style.opacity="0";if(this._state==="hover")this._setState("default")};Z.addEventListener("mouseenter",j),Z.addEventListener("mouseleave",q),this._attributeListeners.set(Z,{enter:j,leave:q})}}_setupMediaCursor(){if(!this._innerElement)return;let J=document.createElement("img");J.setAttribute("data-cursor-media",""),J.style.display="none",this._innerElement.appendChild(J);let $=document.createElement("video");if($.setAttribute("data-cursor-media",""),$.autoplay=!0,$.muted=!0,$.loop=!0,$.style.display="none",this._innerElement.appendChild($),this._config.media)for(let[Z,j]of Object.entries(this._config.media))J.style.setProperty(n(Z),String(j)),$.style.setProperty(n(Z),String(j));let Q=document.querySelectorAll("[mp-cursor-media]");for(let Z of Q){let j=(G)=>{let z=G.target.getAttribute("mp-cursor-media")||"";if(!z||!e6(z)){if(z)console.warn(`[Motion] Blocked unsafe media URL: "${z}". Only http/https URLs and relative paths are allowed.`);return}if(z.endsWith(".mp4")||z.endsWith(".webm"))$.src=z,$.style.display="block",J.style.display="none",$.play().catch(()=>{}),this._mediaElement=$;else J.src=z,J.style.display="block",$.style.display="none",this._mediaElement=J;this._setState("hover")},q=()=>{if(J.style.display="none",$.style.display="none",$.pause(),this._state==="hover")this._setState("default")};Z.addEventListener("mouseenter",j),Z.addEventListener("mouseleave",q),this._attributeListeners.set(Z,{enter:j,leave:q})}}_removeEventListeners(){if(this._boundMouseMove)document.removeEventListener("mousemove",this._boundMouseMove);if(this._boundMouseDown)document.removeEventListener("mousedown",this._boundMouseDown);if(this._boundMouseUp)document.removeEventListener("mouseup",this._boundMouseUp);if(this._boundHoverTargetMoveHandler)window.removeEventListener("mousemove",this._boundHoverTargetMoveHandler),this._boundHoverTargetMoveHandler=null;this._hoverSelectors=null,this._isHoveringCursorTarget=!1,this._attributeListeners.forEach((J,$)=>{$.removeEventListener("mouseenter",J.enter),$.removeEventListener("mouseleave",J.leave)}),this._attributeListeners.clear()}_setState(J){if(this._state===J)return;let $=this._state;this._state=J;let Q=this._stateTimelines.get(J),Z=this._stateTimelines.get($);if(J==="default"){if(Z)Z.reverse()}else{if($!=="default"&&Z)Z.reverse();if(Q)Q.play()}}_tick(J){if(!this._xSetter||!this._ySetter)return;let $=this._config.smooth??0.25,Q=Math.pow($,2.5)||0.000001,Z=1-Math.pow(1-Q,J*60);if(this._cursorPos.x+=(this._mousePos.x-this._cursorPos.x)*Z,this._cursorPos.y+=(this._mousePos.y-this._cursorPos.y)*Z,this._xSetter(this._cursorPos.x),this._ySetter(this._cursorPos.y),this._squeezeSetter&&this._config.squeeze){let j=this._calculateSqueeze();this._squeezeSetter(j)}for(let j of this._stateTimelines.values())if(j.isActive())j.update(J)}_calculateSqueeze(){let J=this._cursorPos.x-this._mousePos.x,$=this._cursorPos.y-this._mousePos.y,Q=Math.sqrt(J*J+$*$),{min:Z,max:j,multiplier:q}=this._squeezeConfig,G=1-(Math.exp(Q/q)-1)/10;if(Number.isNaN(G))return 1;return Math.max(Z,Math.min(j,G))}getElement(){return this._element}getState(){return this._state}}L.registerTrigger("cursor",_0);class oJ extends u{_links=[];_listeners=new Map;_isNavigating=!1;_pendingUrl=null;_onCompleteHandler=null;_pollTimerId=null;constructor(J,$){super(J,$)}_onEnable(){if(this._isInsideBuilder())return;this._resolveLinks(),this._addClickListeners()}_onDisable(){if(this._cleanupListenerMap(this._listeners),this._links=[],this._isNavigating=!1,this._pendingUrl=null,this._pollTimerId!==null)clearTimeout(this._pollTimerId),this._pollTimerId=null;if(this._onCompleteHandler)this._onCompleteHandler=null}_isInsideBuilder(){try{if(typeof window<"u"&&window.top?.mp_iframe)return!0}catch{}return!1}_resolveLinks(){if(typeof document>"u")return;let J=this._config.mode||"all",$;if(J==="include"&&this._config.selectors&&this._config.selectors.trim()!=="")try{$=Array.from(document.querySelectorAll(this._config.selectors)).filter((Z)=>Z.tagName==="A"),document.querySelectorAll(this._config.selectors).forEach((Z)=>{if(Z.tagName!=="A"){let j=Z.querySelectorAll("a");$.push(...Array.from(j))}})}catch(Q){console.warn(`[Motion] Invalid selector "${this._config.selectors}":`,Q),$=[]}else if(J==="include")$=[];else if(J==="exclude"&&this._config.selectors&&this._config.selectors.trim()!==""){let Q=Array.from(document.querySelectorAll("a")),Z;try{Z=new Set(document.querySelectorAll(this._config.selectors))}catch(j){console.warn(`[Motion] Invalid selector "${this._config.selectors}":`,j),Z=new Set}$=Q.filter((j)=>!Z.has(j))}else $=Array.from(document.querySelectorAll("a"));this._links=[...new Set($)],this._links=this._links.filter((Q)=>this._shouldIntercept(Q))}_shouldIntercept(J){let $=J.getAttribute("href");if(!$||$==="")return!1;let Q=this._config.skipHref||[];if($.startsWith("#"))return!Q.includes("anchor");if($.toLowerCase().startsWith("javascript:"))return!Q.includes("javascript");if($.toLowerCase().startsWith("mailto:")||$.toLowerCase().startsWith("tel:"))return!Q.includes("mailto");return!0}_addClickListeners(){this._links.forEach((J)=>{let $=new Map,Q=(Z)=>{if(this._isNavigating)return;let j=Z;if(j.ctrlKey||j.metaKey||j.shiftKey||j.altKey)return;let q=J.getAttribute("target");if(q&&q!=="_self")return;let G=J.href;if(!G)return;Z.preventDefault(),Z.stopPropagation(),this._isNavigating=!0,this._pendingUrl=G,this._onCompleteHandler=()=>{this._navigate()},this._timeline.restart(),this._waitForCompletion()};J.addEventListener("click",Q),$.set("click",Q),this._listeners.set(J,$)})}_waitForCompletion(){let J=this._timeline,$=16,Q=()=>{if(this._pollTimerId=null,!this._enabled||!this._isNavigating||!this._pendingUrl)return;let Z=J.progress(),j=J.isActive();if(Z>=1||!j&&Z>0)this._navigate();else this._pollTimerId=setTimeout(Q,16)};this._pollTimerId=setTimeout(Q,16)}_navigate(){if(!this._pendingUrl)return;let J=this._pendingUrl;if(this._pendingUrl=null,this._isNavigating=!1,typeof window<"u")window.location.href=J}}L.registerTrigger("pageExit",oJ);var YJ=null;function J7(){if(!YJ&&typeof document<"u"){let J=document.createElement("canvas");J.width=1,J.height=1,YJ=J.getContext("2d")}return YJ}function sJ(J){let $=J.replace("#",""),Q,Z,j,q=1;if($.length===3)Q=parseInt($[0]+$[0],16),Z=parseInt($[1]+$[1],16),j=parseInt($[2]+$[2],16);else if($.length===4)Q=parseInt($[0]+$[0],16),Z=parseInt($[1]+$[1],16),j=parseInt($[2]+$[2],16),q=parseInt($[3]+$[3],16)/255;else if($.length===6)Q=parseInt($.slice(0,2),16),Z=parseInt($.slice(2,4),16),j=parseInt($.slice(4,6),16);else if($.length===8)Q=parseInt($.slice(0,2),16),Z=parseInt($.slice(2,4),16),j=parseInt($.slice(4,6),16),q=parseInt($.slice(6,8),16)/255;else return null;if(isNaN(Q)||isNaN(Z)||isNaN(j)||isNaN(q))return null;return new Float32Array([Q,Z,j,q])}function $7(J){let $=J.match(/rgba?\s*\(\s*([\d.]+)\s*[,\s]\s*([\d.]+)\s*[,\s]\s*([\d.]+)\s*(?:[,\/]\s*([\d.]+))?\s*\)/i);if(!$)return null;let Q=parseFloat($[1]),Z=parseFloat($[2]),j=parseFloat($[3]),q=$[4]!==void 0?parseFloat($[4]):1;if(isNaN(Q)||isNaN(Z)||isNaN(j)||isNaN(q))return null;return new Float32Array([Q,Z,j,q])}function Q7(J,$,Q){J=J/360,$=$/100,Q=Q/100;let Z,j,q;if($===0)Z=j=q=Q;else{let G=(N,B,_)=>{if(_<0)_+=1;if(_>1)_-=1;if(_<0.16666666666666666)return N+(B-N)*6*_;if(_<0.5)return B;if(_<0.6666666666666666)return N+(B-N)*(0.6666666666666666-_)*6;return N},z=Q<0.5?Q*(1+$):Q+$-Q*$,W=2*Q-z;Z=G(W,z,J+0.3333333333333333),j=G(W,z,J),q=G(W,z,J-0.3333333333333333)}return[Math.round(Z*255),Math.round(j*255),Math.round(q*255)]}function Z7(J){let $=J.match(/hsla?\s*\(\s*([\d.]+)\s*[,\s]\s*([\d.]+)%\s*[,\s]\s*([\d.]+)%\s*(?:[,\/]\s*([\d.]+))?\s*\)/i);if(!$)return null;let Q=parseFloat($[1]),Z=parseFloat($[2]),j=parseFloat($[3]),q=$[4]!==void 0?parseFloat($[4]):1;if(isNaN(Q)||isNaN(Z)||isNaN(j)||isNaN(q))return null;let[G,z,W]=Q7(Q,Z,j);return new Float32Array([G,z,W,q])}function j7(J,$){if(!$||typeof window>"u")return null;let Q=J.match(/var\s*\(\s*(--[\w-]+)\s*\)/i);if(!Q)return null;let Z=Q[1],j=window.getComputedStyle($).getPropertyValue(Z).trim();if(!j)return null;return HJ(j,$)}function q7(J){let $=J7();if(!$)return null;$.fillStyle="#000000",$.fillStyle=J;let Q=$.fillStyle;if(Q==="#000000"&&J.toLowerCase()!=="black"&&J!=="#000000"&&J!=="#000")return null;return sJ(Q)}function HJ(J,$){if(!J||typeof J!=="string")return null;let Q=J.trim().toLowerCase();if(Q==="transparent")return new Float32Array([0,0,0,0]);if(Q.startsWith("#"))return sJ(Q);if(Q.startsWith("rgb"))return $7(Q);if(Q.startsWith("hsl"))return Z7(Q);if(Q.startsWith("var("))return j7(Q,$);return q7(Q)}function G7(J,$){if(typeof window>"u")return new Float32Array([0,0,0,1]);let Q=window.getComputedStyle(J),Z=$.replace(/[A-Z]/g,(G)=>`-${G.toLowerCase()}`),j=Q.getPropertyValue(Z).trim();if(!j||j==="none")J.offsetHeight,j=window.getComputedStyle(J).getPropertyValue(Z).trim();if(!j||j==="none")return new Float32Array([0,0,0,0]);return HJ(j,J)||new Float32Array([0,0,0,1])}U.color={parseColor:HJ,getCurrentColor:G7};var iJ={blur:{value:0,unit:"px"},brightness:{value:1,unit:""},contrast:{value:1,unit:""},saturate:{value:1,unit:""},grayscale:{value:0,unit:""},sepia:{value:0,unit:""},"hue-rotate":{value:0,unit:"deg"},invert:{value:0,unit:""},opacity:{value:1,unit:""}};function z7(J){let $=J.trim().match(/^([\w-]+)\(\s*([\d.]+)(px|%|deg)?\s*\)$/);if(!$)return null;let Q=$[1].toLowerCase(),Z=parseFloat($[2]),j=$[3]||"";if(j==="%")Z=Z/100,j="";return{name:Q,value:Z,unit:j}}function nJ(J){if(J===null||J===void 0||typeof J!=="string")return null;let $=J.trim().toLowerCase();if($==="none"||$==="")return[];let Q=[],Z=/([\w-]+)\([^)]+\)/g,j;while((j=Z.exec($))!==null){let q=z7(j[0]);if(q)Q.push(q)}return Q.length>0?Q:null}function W7(J){let $=iJ[J.name];if(!$)return!1;return J.value===$.value}function N7(J){if(!J||J.length===0)return"none";if(J.every(W7))return"none";return J.map(($)=>{let Q;if($.name==="blur")Q=`${$.value}${$.unit||"px"}`;else if($.name==="hue-rotate")Q=`${$.value}${$.unit||"deg"}`;else Q=`${$.value}`;return`${$.name}(${Q})`}).join(" ")}function B7(J){if(typeof window>"u")return[];let $=window.getComputedStyle(J),Q=$.filter||$.getPropertyValue("filter");if(!Q||Q==="none")return[];return nJ(Q)||[]}function _7(J){let $=iJ[J];if($)return{name:J,value:$.value,unit:$.unit};return{name:J,value:0,unit:""}}function Y7(J,$){let Q=new Set;for(let q of J)Q.add(q.name);for(let q of $)Q.add(q.name);let Z=[],j=[];for(let q of Q){let G=J.find((N)=>N.name===q),z=$.find((N)=>N.name===q),W=_7(q);Z.push(G||W),j.push(z||W)}return{start:Z,end:j}}var Y0=[];function H7(J,$,Q){let Z=J.length;if(Y0.length<Z)for(let j=Y0.length;j<Z;j++)Y0.push({name:"",value:0,unit:""});for(let j=0;j<Z;j++){let q=J[j],G=$[j],z=Y0[j];z.name=q.name,z.value=q.value+(G.value-q.value)*Q,z.unit=q.unit||G.unit}return Y0.length=Z,Y0}U.filter={parseFilter:nJ,getCurrentFilter:B7,mergeFilterArrays:Y7,interpolateFilters:H7,filterToString:N7};var aJ=new WeakMap;function X7(J){return"getTotalLength"in J&&typeof J.getTotalLength==="function"}function v0(J){let $=aJ.get(J);if($!==void 0)return $;if(X7(J)){let Q=J.getTotalLength();return aJ.set(J,Q),Q}return 0}function K7(J,$){if(J===null||J===void 0)return null;if(typeof J==="object"){let Q=J.start??0,Z=J.end??100;return{start:Q/100,end:Z/100}}if(typeof J==="string"){let Q=J.trim();if(Q==="true")return{start:0,end:1};if(Q==="false"||Q===""||Q==="none")return{start:0,end:0};let Z=Q.match(/^([-\d.]+)(px|%)?\s+([-\d.]+)(px|%)?$/);if(Z){let q=parseFloat(Z[1]),G=Z[2]||"%",z=parseFloat(Z[3]),W=Z[4]||"%",N=$?v0($):0,B=XJ(q,G,N),_=XJ(z,W,N);return{start:B,end:_}}let j=Q.match(/^([-\d.]+)(px|%)?$/);if(j){let q=parseFloat(j[1]),G=j[2]||"%",z=$?v0($):0;return{start:0,end:XJ(q,G,z)}}}return null}function XJ(J,$,Q){if($==="px"&&Q>0)return J/Q;return J/100}function U7(J){let $=v0(J);if($===0)return{start:0,end:1};try{if(typeof window<"u"&&window.getComputedStyle){let Q=window.getComputedStyle(J),Z=Q.strokeDasharray,j=Q.strokeDashoffset;if(!Z||Z==="none")return{start:0,end:1};let q=Z.split(/[\s,]+/).map(parseFloat).filter((z)=>!isNaN(z)),G=parseFloat(j)||0;if(q.length>=1){let z=q[0],W=-G/$,N=(-G+z)/$;return{start:W,end:N}}}}catch{}return{start:0,end:1}}function I7(J,$,Q,Z){if(!(J instanceof SVGElement)||Z===0)return;let j=J,q=Math.abs(Q-$)*Z,G=Math.min($,Q)*Z;j.style.strokeDasharray=`${q} ${Z}`,j.style.strokeDashoffset=`${-G}`}U.drawSVG={parseDrawSVG:K7,getCurrentDrawSVG:U7,getPathLength:v0,applyDrawSVG:I7};var H0=new WeakMap;class h0{static split(J,$,Q){if(!(J instanceof HTMLElement))return[];let Z=Q?.consumer,j=H0.get(J);if(j){if(Z&&j.consumers.has(Z)){if((J.getAttribute("data-split")??"")===$)return this._getSpansForType(j.result,$);j.consumers.delete(Z)}if(Z)j.consumers.add(Z);if(j.consumers.size>1){let _=this._tryUpgrade(J,j,$,Q);if(_!==null)return _;let X=$.split(",").map((Y)=>Y.trim());if(X.includes("chars")&&j.result.chars.length>0)return j.result.chars.slice();if(X.includes("words")&&j.result.words.length>0)return j.result.words.slice();return j.result.elements.slice()}if(Z)j.consumers.delete(Z);J.innerHTML=j.originalHTML,J.removeAttribute("data-split"),H0.delete(J)}let q=J.innerHTML,G={chars:[],words:[],lines:[],elements:[]},z=$.split(",").map((_)=>_.trim()),W=z.includes("chars"),N=z.includes("words"),B=z.includes("lines");if(B)this._splitWithLinesDom(J,N,W,G);else if(N&&W)this._splitWordsWithCharsDom(J,G);else if(N)this._splitWordsDom(J,G);else if(W)this._splitCharsDom(J,G);if(W)G.elements=G.chars;else if(N)G.elements=G.words;else if(B)G.elements=G.lines;if(Q?.mask&&G.elements.length>0)this._applyMaskWrappers(G);return this._propagateGradientText(J,G),H0.set(J,{originalHTML:q,result:G,consumers:new Set(Z?[Z]:[])}),J.setAttribute("data-split",$),G.elements}static _tryUpgrade(J,$,Q,Z){let q=(J.getAttribute("data-split")??"").split(",").map((Y)=>Y.trim()),G=Q.split(",").map((Y)=>Y.trim()),z=G.includes("chars"),W=G.includes("words"),N=G.includes("lines"),B=q.includes("chars"),_=q.includes("words"),X=q.includes("lines");if((!z||B)&&(!W||_)&&(!N||X))return this._getSpansForType($.result,Q);if(N||X)return null;if(_&&!B&&z){let Y=[];for(let I of $.result.words)this._nestCharsInElement(I,Y);$.result.chars=Y,$.result.elements=Y;let H=this._buildTypeString(q,G);if(J.setAttribute("data-split",H),Z?.mask)this._applyMaskWrappers($.result);return this._propagateGradientText(J,$.result),z?Y:$.result.words.slice()}if(B&&!_&&W){let Y=Array.from(J.querySelectorAll("[data-split-word-wrap]")),H=[];for(let K=0;K<Y.length;K++){let F=Y[K];F.removeAttribute("data-split-word-wrap"),F.setAttribute("data-split-word",""),F.setAttribute("data-word-index",String(K)),H.push(F)}$.result.words=H;let I=this._buildTypeString(q,G);return J.setAttribute("data-split",I),z?$.result.chars.slice():H}return null}static _getSpansForType(J,$){let Q=$.split(",").map((Z)=>Z.trim());if(Q.includes("chars")&&J.chars.length>0)return J.chars.slice();if(Q.includes("words")&&J.words.length>0)return J.words.slice();if(Q.includes("lines")&&J.lines.length>0)return J.lines.slice();return J.elements.slice()}static _buildTypeString(J,$){let Q=new Set([...J,...$]);return["lines","words","chars"].filter((Z)=>Q.has(Z)).join(",")}static _nestCharsInElement(J,$){let Q=document.createTreeWalker(J,4),Z=[],j=Q.nextNode();while(j!==null)Z.push(j),j=Q.nextNode();for(let q of Z){let G=q.textContent??"";if(!G)continue;let z=document.createDocumentFragment();for(let W of G)if(/\s/.test(W))z.appendChild(document.createTextNode(W));else{let N=document.createElement("span");N.setAttribute("data-split-char",""),N.setAttribute("data-char-index",String($.length)),N.style.display="inline-block",N.textContent=W,$.push(N),z.appendChild(N)}q.parentNode?.replaceChild(z,q)}}static _splitWordsDom(J,$){let Q=Array.from(J.childNodes);for(let Z of Q)if(Z.nodeType===3){let j=Z.textContent||"";if(!j)continue;let q=j.split(/(\s+)/),G=document.createDocumentFragment(),z=!1;for(let W of q)if(/^\s+$/.test(W))G.appendChild(document.createTextNode(W.replace(/\n/g," "))),z=!0;else if(W){let N=document.createElement("span");N.setAttribute("data-split-word",""),N.setAttribute("data-word-index",String($.words.length)),N.style.display="inline-block",N.textContent=W,$.words.push(N),G.appendChild(N),z=!0}if(z)J.replaceChild(G,Z)}else if(Z.nodeType===1){let j=Z;if(j.tagName==="BR")continue;this._splitWordsDom(j,$)}}static _splitCharsDom(J,$){let Q=Array.from(J.childNodes);for(let Z of Q)if(Z.nodeType===3){let j=Z.textContent||"";if(!j)continue;let q=j.split(/(\s+)/),G=document.createDocumentFragment();for(let z of q)if(/^\s+$/.test(z))G.appendChild(document.createTextNode(z.replace(/\n/g," ")));else if(z){let W=document.createElement("span");W.setAttribute("data-split-word-wrap",""),W.style.display="inline-block",W.style.whiteSpace="nowrap";for(let N of z){let B=document.createElement("span");B.setAttribute("data-split-char",""),B.setAttribute("data-char-index",String($.chars.length)),B.style.display="inline-block",B.textContent=N,$.chars.push(B),W.appendChild(B)}G.appendChild(W)}J.replaceChild(G,Z)}else if(Z.nodeType===1){let j=Z;if(j.tagName==="BR")continue;this._splitCharsDom(j,$)}}static _splitWordsWithCharsDom(J,$){let Q=Array.from(J.childNodes);for(let Z of Q)if(Z.nodeType===3){let j=Z.textContent||"";if(!j)continue;let q=j.split(/(\s+)/),G=document.createDocumentFragment();for(let z of q)if(/^\s+$/.test(z))G.appendChild(document.createTextNode(z.replace(/\n/g," ")));else if(z){let W=document.createElement("span");W.setAttribute("data-split-word",""),W.setAttribute("data-word-index",String($.words.length)),W.style.display="inline-block",W.style.whiteSpace="nowrap";for(let N of z){let B=document.createElement("span");B.setAttribute("data-split-char",""),B.setAttribute("data-char-index",String($.chars.length)),B.style.display="inline-block",B.textContent=N,$.chars.push(B),W.appendChild(B)}$.words.push(W),G.appendChild(W)}J.replaceChild(G,Z)}else if(Z.nodeType===1){let j=Z;if(j.tagName==="BR")continue;this._splitWordsWithCharsDom(j,$)}}static _splitWithLinesDom(J,$,Q,Z){let j={chars:[],words:[],lines:[],elements:[]};this._splitWordsDom(J,j);let q=[],G=[],z=-1/0;for(let Y of j.words){let H=Y.getBoundingClientRect();if(H.top>z+2){if(G.length>0)q.push(G);G=[Y],z=H.top}else G.push(Y)}if(G.length>0)q.push(G);let W=new Map;for(let Y of j.words)W.set(Y,this._getWrapperChain(Y,J));let N="",B=0,_=0,X=0;for(let Y of q){let H="",I=[];for(let K=0;K<Y.length;K++){let F=Y[K],M=F.textContent||"",k=W.get(F)||[],O=0;while(O<I.length&&O<k.length&&I[O]===k[O])O++;for(let P=I.length-1;P>=O;P--)H+=`</${I[P].tagName.toLowerCase()}>`;if(K>0)H+=" ";for(let P=O;P<k.length;P++)H+=this._openTag(k[P]);if(Q){let P="";for(let l0 of M)P+=`<span data-split-char data-char-index="${X}" style="display:inline-block">${this._escapeHtml(l0)}</span>`,X++;if($)H+=`<span data-split-word data-word-index="${_}" style="display:inline-block;white-space:nowrap">${P}</span>`;else H+=P}else if($)H+=`<span data-split-word data-word-index="${_}" style="display:inline-block">${this._escapeHtml(M)}</span>`;else H+=this._escapeHtml(M);_++,I=k}for(let K=I.length-1;K>=0;K--)H+=`</${I[K].tagName.toLowerCase()}>`;N+=`<span data-split-line data-line-index="${B}" style="display:block">${H}</span>`,B++}if(J.innerHTML=N,Q)Z.chars=Array.from(J.querySelectorAll("[data-split-char]"));if($)Z.words=Array.from(J.querySelectorAll("[data-split-word]"));Z.lines=Array.from(J.querySelectorAll("[data-split-line]"))}static _applyMaskWrappers(J){let $=J.elements;for(let Q of $){let Z=Q.hasAttribute("data-split-line"),j=Q.hasAttribute("data-split-word"),q=document.createElement("span");if(q.setAttribute("data-split-mask",""),q.style.overflow="hidden",q.style.display=Z?"block":"inline-block",!Z)q.style.verticalAlign=j?"bottom":"bottom";Q.parentNode.insertBefore(q,Q),q.appendChild(Q)}}static _propagateGradientText(J,$){let Q=window.getComputedStyle(J);if((Q.getPropertyValue("background-clip")||Q.getPropertyValue("-webkit-background-clip"))!=="text")return;let j=J.querySelectorAll("[data-split-mask], [data-split-word], [data-split-word-wrap], [data-split-char], [data-split-line]");for(let q of j)q.style.background="inherit",q.style.backgroundClip="text",q.style.setProperty("-webkit-background-clip","text"),q.style.setProperty("-webkit-text-fill-color","transparent")}static revert(J,$){let Q=H0.get(J);if(!Q)return!1;if($){if(Q.consumers.delete($),Q.consumers.size>0)return!1}if(!(J instanceof HTMLElement))return!1;return J.innerHTML=Q.originalHTML,J.removeAttribute("data-split"),H0.delete(J),!0}static isSplit(J){return J.hasAttribute("data-split")}static getResult(J){return H0.get(J)?.result}static _getWrapperChain(J,$){let Q=[],Z=J.parentElement;while(Z&&Z!==$)Q.unshift(Z),Z=Z.parentElement;return Q}static _openTag(J){let $=J.tagName.toLowerCase(),Q="";for(let Z of Array.from(J.attributes))Q+=` ${Z.name}="${this._escapeHtml(Z.value)}"`;return`<${$}${Q}>`}static _escapeHtml(J){return J.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}}U.textSplitter={split:(J,$,Q)=>h0.split(J,$,Q),revert:(J,$)=>h0.revert(J,$),isSplit:h0.isSplit};class rJ{static resolve(J,$){if(J.length===0)return[];if(J.length===1)return[0];if(typeof $==="number")return J.map((Q,Z)=>Z*$);return this.resolveComplexStagger(J,$)}static resolveComplexStagger(J,$){let Q=J.length;if(Q===1)return[0];let Z;if($.each!==void 0)Z=$.each;else if($.amount!==void 0)Z=$.amount/(Q-1);else Z=0.1;let j=this.getOrdering(J,$),q=Array(Q);for(let G=0;G<Q;G++)q[j[G].originalIndex]=j[G].order*Z;return q}static getOrdering(J,$){let Q=J.length,Z=$.from??"start";if($.grid)return this.getGridOrdering(J,$);switch(Z){case"start":return J.map((j,q)=>({originalIndex:q,order:q}));case"end":return J.map((j,q)=>({originalIndex:q,order:Q-1-q}));case"center":{let j=Math.floor(Q/2);return J.map((q,G)=>{let z=Math.abs(G-j);return{originalIndex:G,order:z}})}case"edges":return J.map((j,q)=>{let G=Math.min(q,Q-1-q);return{originalIndex:q,order:G}});case"random":{let j=J.map((q,G)=>({originalIndex:G,order:Math.random()}));return j.sort((q,G)=>q.order-G.order),j.forEach((q,G)=>{q.order=G}),j}default:if(typeof Z==="number"){let j=Math.max(0,Math.min(Q-1,Z));return J.map((q,G)=>{let z=Math.abs(G-j);return{originalIndex:G,order:z}})}return J.map((j,q)=>({originalIndex:q,order:q}))}}static getGridOrdering(J,$){let Q,Z;if($.grid==="auto"){let z=this.detectGrid(J);Q=z.cols,Z=z.rows}else[Q,Z]=$.grid;let j=$.from??"start",q=$.axis??"x",G=J.map((z,W)=>{let N=W%Q,B=Math.floor(W/Q);return{originalIndex:W,col:N,row:B}});if(j==="random"){let z=G.map((W)=>({originalIndex:W.originalIndex,order:Math.random()}));return z.sort((W,N)=>W.order-N.order),z.forEach((W,N)=>{W.order=N}),z}return G.map((z)=>{let W;if(typeof j==="number"){let N=j%Q,B=Math.floor(j/Q);W=q==="x"?Math.abs(z.col-N)+Math.abs(z.row-B)*0.5:Math.abs(z.row-B)+Math.abs(z.col-N)*0.5}else if(j==="center"){let N=(Q-1)/2,B=(Z-1)/2;W=Math.abs(z.col-N)+Math.abs(z.row-B)}else if(j==="edges"){let N=Math.min(z.col,Q-1-z.col),B=Math.min(z.row,Z-1-z.row);W=Math.min(N,B)}else if(j==="end")W=q==="x"?(Z-1-z.row)*Q+(Q-1-z.col):(Q-1-z.col)*Z+(Z-1-z.row);else W=q==="x"?z.row*Q+z.col:z.col*Z+z.row;return{originalIndex:z.originalIndex,order:W}})}static detectGrid(J){if(J.length===0)return{cols:0,rows:0};let $=J.filter((q)=>q instanceof Element);if($.length===0)return{cols:J.length,rows:1};let Q=new Map;$.forEach((q)=>{let G=q.getBoundingClientRect(),z=Math.round(G.top);Q.set(z,(Q.get(z)||0)+1)});let Z=Q.size;return{cols:Math.ceil(J.length/Z),rows:Z}}}U.stagger={resolve:(J,$)=>rJ.resolve(J,$)};function A7(J,$,Q){if(!(J instanceof HTMLElement))return console.warn("[Motion Fit] Fit animations only support HTML elements. SVG elements are not supported."),null;let Z=document.querySelector($);if(!Z)return console.warn(`[Motion Fit] Target element not found: "${$}". Animation skipped.`),null;if(!(Z instanceof HTMLElement))return console.warn("[Motion Fit] Fit animations only support HTML elements. SVG elements are not supported."),null;if(Z===J)return console.warn("[Motion Fit] Target element is the same as source element. Animation skipped."),null;let j=J.getBoundingClientRect(),q=Z.getBoundingClientRect(),G=j.width===0?1:j.width,z=j.height===0?1:j.height,W=j.left+G/2,N=j.top+z/2,B=q.left+q.width/2,_=q.top+q.height/2,X=B-W,Y=_-N,H=q.width/G,I=q.height/z;if(!Q)return{dx:X,dy:Y,sx:H,sy:I,sourceWidth:j.width,sourceHeight:j.height,targetWidth:q.width,targetHeight:q.height};let K=J.offsetParent??document.documentElement,F=K.getBoundingClientRect(),M=K.scrollLeft??0,k=K.scrollTop??0;return{dx:X,dy:Y,sx:H,sy:I,sourceWidth:j.width,sourceHeight:j.height,targetWidth:q.width,targetHeight:q.height,sourceLeft:J.offsetLeft,sourceTop:J.offsetTop,targetLeft:q.left-F.left+M,targetTop:q.top-F.top+k}}var f=0.01,X0=0.001;function F7(J,$,Q,Z){let{absolute:j=!1,scale:q=!0,resize:G=!1}=Q;if($ instanceof HTMLElement)v($,!1);let z=A7($,Q.target,j);if(!z)return;if(!j)if(G){let W=z.dx-(z.targetWidth-z.sourceWidth)/2,N=z.dy-(z.targetHeight-z.sourceHeight)/2;if(Math.abs(W)>f){let B=Z.acquire();B.init($,"x",0,W,"px"),J.addPropTween(B)}if(Math.abs(N)>f){let B=Z.acquire();B.init($,"y",0,N,"px"),J.addPropTween(B)}if(Math.abs(z.targetWidth-z.sourceWidth)>f){let B=Z.acquire();B.init($,"width",z.sourceWidth,z.targetWidth,"px"),J.addPropTween(B)}if(Math.abs(z.targetHeight-z.sourceHeight)>f){let B=Z.acquire();B.init($,"height",z.sourceHeight,z.targetHeight,"px"),J.addPropTween(B)}}else{let W=p($,"x"),N=p($,"y"),B=W+z.dx,_=N+z.dy;if(Math.abs(B-W)>f||Math.abs(W)>f||Math.abs(B)>f){let X=Z.acquire();X.init($,"x",W,B,"px"),J.addPropTween(X)}if(Math.abs(_-N)>f||Math.abs(N)>f||Math.abs(_)>f){let X=Z.acquire();X.init($,"y",N,_,"px"),J.addPropTween(X)}if(q){let X=p($,"scaleX"),Y=p($,"scaleY"),H=X*z.sx,I=Y*z.sy;if(Math.abs(H-X)>X0||Math.abs(X-1)>X0||Math.abs(H-1)>X0){let K=Z.acquire();K.init($,"scaleX",X,H,""),J.addPropTween(K)}if(Math.abs(I-Y)>X0||Math.abs(Y-1)>X0||Math.abs(I-1)>X0){let K=Z.acquire();K.init($,"scaleY",Y,I,""),J.addPropTween(K)}}}else{let W=$;if(window.getComputedStyle(W).position==="static")W.style.position="absolute";let{sourceLeft:B,sourceTop:_,targetLeft:X,targetTop:Y}=z;if(Math.abs(X-B)>f){let H=Z.acquire();H.init($,"left",B,X,"px"),J.addPropTween(H)}if(Math.abs(Y-_)>f){let H=Z.acquire();H.init($,"top",_,Y,"px"),J.addPropTween(H)}if(q){if(Math.abs(z.targetWidth-z.sourceWidth)>f){let H=Z.acquire();H.init($,"width",z.sourceWidth,z.targetWidth,"px"),J.addPropTween(H)}if(Math.abs(z.targetHeight-z.sourceHeight)>f){let H=Z.acquire();H.init($,"height",z.sourceHeight,z.targetHeight,"px"),J.addPropTween(H)}}}}function O7(J,$,Q,Z){J.setPendingFitSetup((G)=>F7(J,$,Q,G)),J.setLazyStartCapture(!0);let{absolute:j=!1,resize:q=!1}=Q;J.setFitCleanup(()=>{if($ instanceof HTMLElement){if(v($,!0),q)$.style.width="",$.style.height="";if(j)$.style.width="",$.style.height="",$.style.left="",$.style.top=""}})}U.fit={registerPendingSetup:O7};var $6=(J)=>J,L7=$6,E={in:(J)=>J*J,out:(J)=>J*(2-J),inOut:(J)=>J<0.5?2*J*J:-1+(4-2*J)*J},$0={in:(J)=>J*J*J,out:(J)=>--J*J*J+1,inOut:(J)=>J<0.5?4*J*J*J:(J-1)*(2*J-2)*(2*J-2)+1},Q0={in:(J)=>J*J*J*J,out:(J)=>1- --J*J*J*J,inOut:(J)=>J<0.5?8*J*J*J*J:1-8*--J*J*J*J},m={in:(J)=>J*J*J*J*J,out:(J)=>1+--J*J*J*J*J,inOut:(J)=>J<0.5?16*J*J*J*J*J:1+16*--J*J*J*J*J};var T0={in:(J)=>1-Math.cos(J*Math.PI/2),out:(J)=>Math.sin(J*Math.PI/2),inOut:(J)=>-(Math.cos(Math.PI*J)-1)/2},f0={in:(J)=>2**(10*(J-1))*J+J*J*J*J*J*J*(1-J),out:(J)=>1-(2**(10*-J)*(1-J)+(1-J)*(1-J)*(1-J)*(1-J)*(1-J)*(1-J)*J),inOut:(J)=>{if(J<0.5){let Q=J*2;return(2**(10*(Q-1))*Q+Q*Q*Q*Q*Q*Q*(1-Q))/2}let $=(1-J)*2;return 1-(2**(10*($-1))*$+$*$*$*$*$*$*(1-$))/2}},u0={in:(J)=>1-Math.sqrt(1-J*J),out:(J)=>Math.sqrt(1- --J*J),inOut:(J)=>{if((J*=2)<1)return-0.5*(Math.sqrt(1-J*J)-1);return 0.5*(Math.sqrt(1-(J-=2)*J)+1)}};var Q6=(J=1.70158)=>{let $=(Q)=>Q?--Q*Q*((J+1)*Q+J)+1:0;return{in:(Q)=>1-$(1-Q),out:$,inOut:(Q)=>{if(Q<0.5)return(1-$(1-Q*2))/2;return 0.5+$((Q-0.5)*2)/2}}},d0=Q6();var Z6=(J=1,$=0.3)=>{let Q=Math.max(1,J),Z=$/(2*Math.PI)*Math.asin(1/Q),j=$*1.5,q=j/(2*Math.PI)*Math.asin(1/Q);return{in:(G)=>{if(G===0)return 0;if(G===1)return 1;return-(Q*Math.pow(2,10*(G-=1))*Math.sin((G-Z)*(2*Math.PI)/$))},out:(G)=>{if(G===0)return 0;if(G===1)return 1;return Q*Math.pow(2,-10*G)*Math.sin((G-Z)*(2*Math.PI)/$)+1},inOut:(G)=>{if(G===0)return 0;if(G===1)return 1;if((G*=2)<1)return-0.5*(Q*Math.pow(2,10*(G-=1))*Math.sin((G-q)*(2*Math.PI)/j));return Q*Math.pow(2,-10*(G-=1))*Math.sin((G-q)*(2*Math.PI)/j)*0.5+1}}},p0=Z6(),tJ=(J)=>{if(J<0.36363636363636365)return 7.5625*J*J;else if(J<0.7272727272727273)return 7.5625*(J-=0.5454545454545454)*J+0.75;else if(J<0.9090909090909091)return 7.5625*(J-=0.8181818181818182)*J+0.9375;else return 7.5625*(J-=0.9545454545454546)*J+0.984375},K0={in:(J)=>1-tJ(1-J),out:tJ,inOut:(J)=>{if(J<0.5)return K0.in(J*2)*0.5;return K0.out(J*2-1)*0.5+0.5}},M0=(J=0.7,$=0.7,Q=!1)=>{let Z=J!==1?$:0,j=(1-J)/2,q=j+J,G=Q;return(z)=>{let W=z+(0.5-z)*Z;if(z<j){let N=1-z/j;if(G)return 1-N*N;return W-N*N*N*N*W}else if(z>q){let N=(z-q)/j;if(G)return z===1?0:1-N*N;return W+(z-W)*N*N*N*N}return G?1:W}},eJ={in:M0(0.7,0.7,!1),out:M0(0.7,0.7,!1),inOut:M0(0.7,0.7,!1)},m0=(J=1,$=20,Q=!1)=>{let Z=[],j=1/$;for(let q=0;q<$;q++){let G=q*j,W=((q*1327+531)%1000/1000-0.5)*J*0.4,N=G+W;Z.push({x:G,y:Q?Math.max(0,Math.min(1,N)):N})}return Z[0]={x:0,y:0},Z.push({x:1,y:1}),(q)=>{if(q<=0)return 0;if(q>=1)return 1;let G=0,z=Z.length-1;while(G<z-1){let _=G+z>>1;if(Z[_].x<=q)G=_;else z=_}let W=Z[G],N=Z[z],B=(q-W.x)/(N.x-W.x);return W.y+(N.y-W.y)*B}},M7={in:m0(1,20,!0),out:m0(1,20,!0),inOut:m0(1,20,!0)},g0=(J)=>{return($)=>{if($>=1)return 1;return Math.floor($*J)/J}},c0={in:g0(12),out:g0(12),inOut:g0(12)},J6={linear:$6,none:L7,power1:E.out,"power1.in":E.in,"power1.out":E.out,"power1.inout":E.inOut,power2:$0.out,"power2.in":$0.in,"power2.out":$0.out,"power2.inout":$0.inOut,power3:Q0.out,"power3.in":Q0.in,"power3.out":Q0.out,"power3.inout":Q0.inOut,power4:m.out,"power4.in":m.in,"power4.out":m.out,"power4.inout":m.inOut,quad:E.out,"quad.in":E.in,"quad.out":E.out,"quad.inout":E.inOut,cubic:$0.out,"cubic.in":$0.in,"cubic.out":$0.out,"cubic.inout":$0.inOut,quart:Q0.out,"quart.in":Q0.in,"quart.out":Q0.out,"quart.inout":Q0.inOut,quint:m.out,"quint.in":m.in,"quint.out":m.out,"quint.inout":m.inOut,strong:m.out,"strong.in":m.in,"strong.out":m.out,"strong.inout":m.inOut,sine:T0.out,"sine.in":T0.in,"sine.out":T0.out,"sine.inout":T0.inOut,expo:f0.out,"expo.in":f0.in,"expo.out":f0.out,"expo.inout":f0.inOut,circ:u0.out,"circ.in":u0.in,"circ.out":u0.out,"circ.inout":u0.inOut,back:d0.out,"back.in":d0.in,"back.out":d0.out,"back.inout":d0.inOut,elastic:p0.out,"elastic.in":p0.in,"elastic.out":p0.out,"elastic.inout":p0.inOut,bounce:K0.out,"bounce.in":K0.in,"bounce.out":K0.out,"bounce.inout":K0.inOut,slow:eJ.inOut,"slow.in":E.out,"slow.out":E.out,"slow.inout":E.out,slowmo:eJ.inOut,"slowmo.in":E.out,"slowmo.out":E.out,"slowmo.inout":E.out,rough:M7.inOut,"rough.in":E.out,"rough.out":E.out,"rough.inout":E.out,steps:c0.inOut,"steps.in":c0.in,"steps.out":c0.out,"steps.inout":c0.inOut},k7={back:(J)=>Q6(J),elastic:(J,$)=>Z6(J,$),slow:(J,$,Q)=>{let Z=M0(J,$,Q===1);return{in:Z,out:Z,inOut:Z}},slowmo:(J,$,Q)=>{let Z=M0(J,$,Q===1);return{in:Z,out:Z,inOut:Z}},rough:(J,$,Q)=>{let Z=m0(J,$,Q===1);return{in:Z,out:Z,inOut:Z}},steps:(J)=>{let $=g0(J??12);return{in:$,out:$,inOut:$}}},D7=/^(\w+)(?:\.(\w+))?\(([^)]*)\)$/;function j6(J){let $=J.toLowerCase();if(J6[$])return J6[$];let Q=D7.exec($);if(Q){let[,Z,j,q]=Q,G=k7[Z];if(G){let z=q.split(",").map((W)=>W.trim()).filter((W)=>W.length>0).map(Number);if(z.every((W)=>!isNaN(W))){let W=G(...z),N=j||"out",_=W[N==="inout"?"inOut":N];if(_)return _}}}return console.warn(`[Motion] Unknown easing "${J}". Falling back to "power1.out". Valid easings: linear, power1-4.in/out/inOut, quad, cubic, quart, quint, strong, sine, expo, circ, back, elastic, bounce, slow, rough, steps. Parameterized: back.out(overshoot), elastic.out(amplitude, period), steps(n), slow(ratio, power, yoyo), rough(strength, points, clamp)`),E.out}class KJ{_id=0;_targets=[];_duration=0.5;_delay=0;_time=0;_progress=0;_timeScale=1;_isActive=!1;_isReversed=!1;_propTweens=null;_lastPropTween=null;_easingFn=null;_repeat=0;_repeatDelay=0;_yoyo=!1;_currentRepeat=0;_onStart;_onUpdate;_onComplete;_onRepeat;_onReverseComplete;_startFired=!1;_completeFired=!1;_timelineChild=!1;_needsStartCapture=!1;_startCaptured=!1;_fitSetupFn=null;_pendingFitSetup=null;_fitCleanupFn=null;_unregisterCallback=null;init(J,$,Q,Z,j,q){return this._id=J,this._targets=$,this._duration=Q,this._delay=Z,this._easingFn=j6(j),this._time=0,this._progress=0,this._timeScale=1,this._isActive=!1,this._isReversed=!1,this._startFired=!1,this._completeFired=!1,this._currentRepeat=0,this._repeat=q?.repeat??0,this._repeatDelay=q?.repeatDelay??0,this._yoyo=q?.yoyo??!1,this._onStart=q?.onStart,this._onUpdate=q?.onUpdate,this._onComplete=q?.onComplete,this._onRepeat=q?.onRepeat,this._onReverseComplete=q?.onReverseComplete,this}update(J){if(!this._isActive)return;let $=J*this._timeScale;if(this._time+=this._isReversed?-$:$,!this._isReversed&&this._time<0){this._time=0;return}let Q=Math.max(0,this._time-this._delay);if(this._progress=this._duration>0?Math.min(1,Q/this._duration):1,!this._startFired&&this._progress>0)this._startFired=!0,this._onStart?.();if(this.render(this._progress),this._onUpdate?.(this._progress),this._isReversed){if(this._time<=0)this.handleComplete()}else if(this._progress>=1)this.handleComplete()}render(J){let $=this.applyEasing(J),Q=this._propTweens;while(Q)Q.render($),Q=Q.next}renderAtTime(J){let $=Math.max(0,J),Q=this._duration,Z=this._delay,j=this._currentRepeat;if(Q===0){let q=$>=Z?1:0;this._time=$,this._progress=q,this.render(q)}else{let q=Math.max(0,$-Z);if(this._repeat===0){let G=Math.min(1,q/Q);this._time=Math.min(Q,q),this._progress=G,this.render(G)}else{let G=this._repeatDelay,z=Q+G,W=this._repeat===-1?1/0:Q*(this._repeat+1)+G*this._repeat,N=this._repeat===-1?q:Math.min(q,W),B=z>0?Math.floor(N/z):0,_=N-B*z,X=_>Q,Y=Q>0?Math.min(1,_/Q):1,H=this._yoyo&&B%2===1;if(X)Y=H?0:1;else if(H)Y=1-Y;this._currentRepeat=this._repeat===-1?B:Math.min(B,this._repeat),this._isReversed=H,this._progress=Y,this._time=Q*Y,this.render(Y)}}if(this._isActive){if(!this._startFired){this._startFired=!0;try{this._onStart?.()}catch(q){console.error("[Motion] onStart callback error:",q)}}try{this._onUpdate?.(this._progress)}catch(q){console.error("[Motion] onUpdate callback error:",q)}if(this._currentRepeat>j)try{this._onRepeat?.(this._currentRepeat)}catch(q){console.error("[Motion] onRepeat callback error:",q)}if(!this._completeFired&&this._repeat!==-1){if($>=this.totalDuration()){this._completeFired=!0;try{this._onComplete?.()}catch(q){console.error("[Motion] onComplete callback error:",q)}}}}}applyEasing(J){if(!this._easingFn)return J;return this._easingFn(J)}handleComplete(){if(this._repeat===-1||this._currentRepeat<this._repeat){if(this._currentRepeat++,this._onRepeat?.(this._currentRepeat),this._yoyo)this._isReversed=!this._isReversed,this._time=this._isReversed?this._duration+this._delay:0;else this._time=0,this._startFired=!1;this._time-=this._repeatDelay;return}if(this._isReversed)this._onReverseComplete?.();else this._onComplete?.();this._isActive=!1}play(J){if(J!==void 0)return this.seek(J),this._isActive=!0,this._isReversed=!1,this;if(this._isActive&&!this._isReversed)return this;return this._isActive=!0,this._isReversed=!1,this}pause(J){if(J!==void 0){this._time=J;let $=Math.max(0,this._time-this._delay);this._progress=this._duration>0?Math.min(1,$/this._duration):1,this.render(this._progress)}return this._isActive=!1,this}reverse(J){if(J!==void 0)this.seek(J);return this._isActive=!0,this._isReversed=!0,this}restart(J=!0){return this._time=J?0:this._delay,this._progress=0,this._isActive=!0,this._isReversed=!1,this._startFired=!1,this._currentRepeat=0,this.render(0),this}seek(J){this._time=J;let $=Math.max(0,this._time-this._delay);return this._progress=this._duration>0?Math.min(1,$/this._duration):1,this.render(this._progress),this}progress(J){if(J===void 0)return this._progress;if(this._progress=Math.max(0,Math.min(1,J)),this._progress===0)this._time=0;else this._time=this._progress*this._duration+this._delay;return this.render(this._progress),this}time(J){if(J===void 0)return this._time;this._time=J;let $=Math.max(0,this._time-this._delay);return this._progress=this._duration>0?Math.min(1,$/this._duration):1,this.render(this._progress),this}timeScale(J){if(J===void 0)return this._timeScale;return this._timeScale=J,this}getTimeScale(){return this._timeScale}kill(){this._isActive=!1,this._unregisterCallback?.()}isActive(){return this._isActive}isTimelineChild(){return this._timelineChild}setTimelineChild(J){this._timelineChild=J}setLazyStartCapture(J){this._needsStartCapture=J,this._startCaptured=!1}setPendingFitSetup(J){this._fitSetupFn=J,this._pendingFitSetup=J}setFitCleanup(J){this._fitCleanupFn=J}resetForReplay(){if(this._fitSetupFn)this._fitCleanupFn?.(),this._pendingFitSetup=this._fitSetupFn,this._startCaptured=!1;this._startFired=!1,this._completeFired=!1}needsStartCapture(){return this._needsStartCapture&&!this._startCaptured}isLazyCapture(){return this._needsStartCapture}fireReverseComplete(){try{this._onReverseComplete?.()}catch(J){console.error("[Motion] onReverseComplete callback error:",J)}this._startFired=!1,this._completeFired=!1}setUnregisterCallback(J){this._unregisterCallback=J}captureStartValues(){if(!this._needsStartCapture||this._startCaptured)return;if(this._pendingFitSetup){let $=this._propTweens;while($){let Q=$.next;J0.release($),$=Q}this._propTweens=null,this._lastPropTween=null,this._pendingFitSetup(J0),this._pendingFitSetup=null,this._startCaptured=!0;return}let J=this._propTweens;while(J){if(J.target instanceof Element){let{target:$,property:Q}=J;if(J.valueType==="color"&&q0(Q)){let Z=U.color?.getCurrentColor($,Q);if(Z&&J.endColor)J.startColor=Z,J.changeColor=new Float32Array([J.endColor[0]-Z[0],J.endColor[1]-Z[1],J.endColor[2]-Z[2],J.endColor[3]-Z[3]])}else if(J.valueType==="filter"&&r(Q)){let Z=U.filter?.getCurrentFilter($);if(Z&&J.endFilters){let j=U.filter.mergeFilterArrays(Z,J.endFilters);J.startFilters=j.start,J.endFilters=j.end}}else{let Z=p($,Q);J.startValue=Z,J.change=J.endValue-J.startValue}}J=J.next}this._startCaptured=!0}getId(){return this._id}getTargets(){return this._targets}getDuration(){return this._duration}getDelay(){return this._delay}clearDelay(){this._delay=0}getFirstPropTween(){return this._propTweens}addPropTween(J){if(!this._lastPropTween)this._propTweens=J;else this._lastPropTween.next=J;this._lastPropTween=J}totalDuration(){if(this._repeat===-1)return 1/0;let $=this._duration*(this._repeat+1)+this._repeatDelay*this._repeat;return this._delay+$}reset(){this._id=0,this._targets=[],this._duration=0.5,this._delay=0,this._time=0,this._progress=0,this._timeScale=1,this._isActive=!1,this._isReversed=!1,this._easingFn=null,this._repeat=0,this._repeatDelay=0,this._yoyo=!1,this._currentRepeat=0,this._onStart=void 0,this._onUpdate=void 0,this._onComplete=void 0,this._onRepeat=void 0,this._onReverseComplete=void 0,this._startFired=!1,this._completeFired=!1,this._timelineChild=!1,this._needsStartCapture=!1,this._startCaptured=!1,this._fitSetupFn=null,this._pendingFitSetup=null,this._fitCleanupFn=null,this._unregisterCallback=null;let J=J0,$=this._propTweens;while($){let Q=$.next;J.release($),$=Q}this._propTweens=null,this._lastPropTween=null}}var k0=new O0(()=>new KJ,100),q6={acquire:()=>k0.acquire(),release:(J)=>k0.release(J),getPoolSize:()=>k0.getPoolSize(),getTotalCreated:()=>k0.getTotalCreated(),clear:()=>k0.clear()};class x{static instance;animations=[];animationIdToIndex=new Map;nextAnimationId=1;totalCreated=0;_animationSnapshot=[];timelines=new Map;ticker;animationPool;propTweenPool;constructor(){this.ticker=C.getInstance(),this.animationPool=q6,this.propTweenPool=J0,this.ticker.add(this.update,0)}static getInstance(){if(!x.instance)x.instance=new x,b.setEngineRegisterCallback((J,$)=>{let Q=x.instance;if(!Q.hasTimeline(J))Q.registerTimeline(J,$)}),c.setCreateAnimationCallback((J,$,Q,Z,j,q,G,z)=>{return x.instance.createAnimation(J,$,Q,Z,j,q,G,z)});return x.instance}update=(J)=>{let $=this._animationSnapshot,Q=this.animations.length;$.length=Q;for(let j=0;j<Q;j++)$[j]=this.animations[j];let Z=[];for(let j=0,q=$.length;j<q;j++){let G=$[j];if(G.isTimelineChild())continue;if(G.isActive()){if(G.update(J),!G.isActive()&&!G.isTimelineChild())Z.push(G.getId())}}for(let j of Z)this.unregisterAnimation(j);for(let j of this.timelines.values())if(j.isActive())j.update(J)};createAnimation(J,$,Q,Z,j,q,G,z){let W=z?.stagger;if(W&&J.length>1)return this.createStaggeredAnimations(J,$,Q,Z,j,q,G,W,z);let N=this.animationPool.acquire(),B=this.registerAnimation(N);if(N.init(B,J,Q,Z,j,z),this.setupPropertyTweens(N,J,$,q,G),Q===0)N.render(1);else if(q&&!z?._skipInitialRender)N.render(0);return N}createStaggeredAnimations(J,$,Q,Z,j,q,G,z,W){if(!U.stagger){let _=this.animationPool.acquire(),X=this.registerAnimation(_);if(_.init(X,J,Q,Z,j,W),this.setupPropertyTweens(_,J,$,q,G),Q===0)_.render(1);else if(q&&!W?._skipInitialRender)_.render(0);return[_]}let N=U.stagger.resolve(J,z),B=[];for(let _=0;_<J.length;_++){let X=J[_],Y=N[_],H=this.animationPool.acquire(),I=this.registerAnimation(H);if(H.init(I,[X],Q,Z+Y,j,W),this.setupPropertyTweens(H,[X],$,q,G),Q===0)H.render(1);else if(q&&!W?._skipInitialRender)H.render(0);B.push(H)}return B}setupPropertyTweens(J,$,Q,Z,j){let q=G6(Q),G=j?G6(j):void 0,z=Object.keys(q),W=G?Object.keys(G):[],N=[...new Set([...z,...W])],B="perspective"in q,_=G&&"perspective"in G,X=B&&_;for(let Y of $){if(!X&&(B||_)&&Y instanceof Element){let H=B?q.perspective:G.perspective,I=typeof H==="number"?H:parseFloat(String(H))||0;if(I>0)y(Y,"perspective",I,"px"),Y.style.transform=R(Y)}for(let H of N){if(H==="perspective"&&!X)continue;let I=q[H],K=vJ(Y,H,I,G?G[H]:void 0),F=this.propTweenPool.acquire(),M=Z&&!j;switch(K.type){case"color":{let k=M?K.endColor:K.startColor,O=M?K.startColor:K.endColor;F.initColor(Y,H,k,O);break}case"filter":{let k=M?K.endFilters:K.startFilters,O=M?K.startFilters:K.endFilters;F.initFilter(Y,H,k,O);break}case"scalar":{let k=M?K.endValue:K.startValue,O=M?K.startValue:K.endValue;F.init(Y,H,k,O,K.unit);break}case"drawSVG":{let k=M?K.endDraw:K.startDraw,O=M?K.startDraw:K.endDraw;F.initDrawSVG(Y,H,k,O,K.length);break}case"path":{let k=M?K.endProgress:K.startProgress,O=M?K.startProgress:K.endProgress;F.initPath(Y,H,K.pathData,K.pathLength,k,O,K.rotate,K.alignOffset,K.pathOffset);break}}J.addPropTween(F)}}}registerAnimation(J){let $=this.nextAnimationId++,Q=this.animations.length;return this.animations.push(J),this.animationIdToIndex.set($,Q),this.totalCreated++,J.setUnregisterCallback(()=>this.unregisterAnimation($)),$}unregisterAnimation(J){let $=this.animationIdToIndex.get(J);if($===void 0)return;let Q=this.animations[$],Z=this.animations.length-1;if($!==Z){let j=this.animations[Z];this.animations[$]=j,this.animationIdToIndex.set(j.getId(),$)}this.animations.pop(),this.animationIdToIndex.delete(J),this.animationPool.release(Q)}getAnimation(J){let $=this.animationIdToIndex.get(J);return $!==void 0?this.animations[$]:void 0}killAll(){let J=[...this.animations];for(let $=0,Q=J.length;$<Q;$++)J[$].kill();this.animations.length=0,this.animationIdToIndex.clear()}killAnimationsForTargets(J){if(J.length===0)return;let $=new Set(J),Q=[];for(let Z=0,j=this.animations.length;Z<j;Z++){let q=this.animations[Z],G=q.getTargets();for(let z of G)if(z instanceof Element&&$.has(z)){Q.push(q);break}}for(let Z of Q)Z.kill()}getActiveCount(){let J=0;for(let $=0,Q=this.animations.length;$<Q;$++)if(this.animations[$].isActive())J++;return J}getTotalCreated(){return this.totalCreated}getTimeline(J){let $=this.timelines.get(J);if(!$){if($=new b(J),!this.timelines.has(J))this.timelines.set(J,$),$.setUnregisterCallback(()=>this.removeTimeline(J))}return $}hasTimeline(J){return this.timelines.has(J)}registerTimeline(J,$){this.timelines.set(J,$),$.setUnregisterCallback(()=>this.removeTimeline(J))}getTimelineCount(){return this.timelines.size}getTimelineNames(){return Array.from(this.timelines.keys())}removeTimeline(J){this.timelines.delete(J)}killAllTimelines(){for(let J of this.timelines.values())J.kill();this.timelines.clear()}killEverything(){this.killAllTimelines(),this.killAll(),VJ()}getAnimationPool(){return this.animationPool}getPropTweenPool(){return this.propTweenPool}getPoolStats(){return{animations:this.animationPool.getPoolSize(),propTweens:this.propTweenPool.getPoolSize()}}clearPools(){this.animationPool.clear(),this.propTweenPool.clear()}getMemoryEstimate(){let J=this.animations.length,$=this.animationPool.getPoolSize(),Q=this.propTweenPool.getPoolSize();return(J+$)*500+Q*100}getTicker(){return this.ticker}}function G6(J){let $=!1;for(let Z of Object.keys(J))if(Z.includes("-")&&!Z.startsWith("--")){$=!0;break}if(!$)return J;let Q={};for(let[Z,j]of Object.entries(J))if(Z.includes("-")&&!Z.startsWith("--")){let q=Z.replace(/-([a-z])/g,(G,z)=>z.toUpperCase());Q[q]=j}else Q[Z]=j;return Q}function R7(J,$){if(typeof J==="string"){let Q=$||(typeof document<"u"?document:null);if(!Q)return[];try{return Array.from(Q.querySelectorAll(J))}catch{return[]}}if(typeof Element<"u"&&J instanceof Element)return[J];if(typeof NodeList<"u"&&J instanceof NodeList||typeof HTMLCollection<"u"&&J instanceof HTMLCollection)return Array.from(J);if(Array.isArray(J))return J;if(J&&typeof J==="object"&&"length"in J)return Array.from(J);return[]}function E7(J,$,Q){if(Q===void 0)return(Z)=>Math.min($,Math.max(J,Z));return Math.min($,Math.max(J,Q))}function b7(J,$,Q){let Z=J+Math.random()*($-J);if(Q&&Q>0)return Math.round(Z/Q)*Q;return Z}function x7(J,$){let Q=(Z)=>{if(typeof J==="number"){if(J<=0)return Z;return Math.round(Z/J)*J}let j=J,q=j[0],G=Math.abs(Z-q);for(let z=1;z<j.length;z++){let W=Math.abs(Z-j[z]);if(W<G)G=W,q=j[z]}return q};if($===void 0)return Q;return Q($)}function C7(J,$,Q){return J+($-J)*Q}function V7(J,$,Q,Z,j){let q=(G)=>{let z=(G-J)/($-J);return Q+z*(Z-Q)};if(j===void 0)return q;return q(j)}function w7(J,$,Q){let Z=(j)=>(j-J)/($-J);if(Q===void 0)return Z;return Z(Q)}function P7(J,$,Q){let Z=$-J,j=(q)=>{return((q-J)%Z+Z)%Z+J};if(Q===void 0)return j;return j(Q)}var UJ={toArray:R7,clamp:E7,random:b7,snap:x7,interpolate:C7,mapRange:V7,normalize:w7,wrap:P7};function l(J,$,Q){let j=x.getInstance().getTimeline(J);if($!==void 0&&j.duration()>0)console.warn(`[Motion] Timeline "${J}" already has animations. New entries will be appended. Call Motion("${J}").kill() first to rebuild from scratch.`);if(Array.isArray($)&&$.length>0&&typeof $[0]==="object"&&$[0]!==null&&"target"in $[0])for(let q of $)j._addEntry(q.target,q,q.position);else if($!==void 0&&Q!==void 0)j._addEntry($,Q);return j}l.reset=function(J){x.getInstance();let $=D0(J),Q=[];for(let Z of $)if(Z instanceof Element)Q.push(Z);if(Q.length>0)x.getInstance().killAnimationsForTargets(Q);for(let Z of $){if(!(Z instanceof Element))continue;if(U.textSplitter?.isSplit?.(Z))U.textSplitter?.revert?.(Z);v(Z),U.styleReset?.clearAnimationStylesAndUnregister?.(Z),U.styleReset?.clearPinStylesAndUnregister?.(Z)}};l.set=function(J,$){x.getInstance();let Q=new b;Q._addEntry(J,{to:$,duration:0}),Q.kill(!1)};l.get=function(J){let $=x.getInstance();return $.hasTimeline(J)?$.getTimeline(J):void 0};l.has=function(J){return x.getInstance().hasTimeline(J)};l.getNames=function(){return x.getInstance().getTimelineNames()};l.kill=function(J){let $=x.getInstance();if($.hasTimeline(J))$.getTimeline(J).kill()};l.killAll=function(){x.getInstance().killEverything()};l.refreshScrollTriggers=function(){U.triggerManager?.getInstance?.()?.refreshScrollTriggers()};l.cleanup=function(){if(typeof document>"u")return;document.querySelectorAll("[data-scrolltrigger-spacer]").forEach((J)=>J.remove()),document.querySelectorAll("[data-scrolltrigger-markers]").forEach((J)=>J.remove())};l.utils=UJ;var S7=l;var y7={};export{y7 as Types,b as Timeline,UJ as MotionUtils,S7 as Motion};
|
|
30
32
|
|
|
31
|
-
//# debugId=
|
|
33
|
+
//# debugId=70D068328A99117864756E2164756E21
|
|
32
34
|
//# sourceMappingURL=index.js.map
|