@motion.page/sdk 1.0.7 → 1.0.8
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/core/AnimationBuilder.d.ts +2 -0
- package/dist/core/Timeline.d.ts +0 -12
- package/dist/index.cjs +11 -11
- package/dist/index.cjs.map +6 -6
- package/dist/index.js +11 -11
- package/dist/index.js.map +6 -6
- package/dist/triggers/TriggerManager.d.ts +28 -0
- package/dist/types/index.d.ts +7 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
var{defineProperty:r0,getOwnPropertyNames:I6,getOwnPropertyDescriptor:A6}=Object,F6=Object.prototype.hasOwnProperty;function O6(J){return this[J]}var L6=(J)=>{var $=(OJ??=new WeakMap).get(J),Q;if($)return $;if($=r0({},"__esModule",{value:!0}),J&&typeof J==="object"||typeof J==="function"){for(var Z of I6(J))if(!F6.call($,Z))r0($,Z,{get:O6.bind(J,Z),enumerable:!(Q=A6(J,Z))||Q.enumerable})}return OJ.set(J,$),$},OJ;var M6=(J)=>J;function k6(J,$){this[J]=M6.bind(null,$)}var D6=(J,$)=>{for(var Q in $)r0(J,Q,{get:$[Q],enumerable:!0,configurable:!0,set:k6.bind($,Q)})};var l7={};D6(l7,{Types:()=>B6,Timeline:()=>E,MotionUtils:()=>l0,Motion:()=>N6});module.exports=L6(l7);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 MJ(J){if(typeof document>"u"){J();return}if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",J,{once:!0});else J()}function LJ(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(LJ(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(LJ(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,MJ(()=>{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 kJ 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",kJ);var JJ={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},RJ=["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=JJ[$];if(j===void 0)return;J.values[j]=Q;let q=Z&&Z.length>0?Z:RJ[j]||"";J.units[j]=q,J.used|=1<<j}function R6(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 t0(J,$,Q,Z,j,q,G,z,W,N,B,_,X,Y){if(X){let Z0=Math.hypot(J,$),X6=J*j-$*Z,K6=Z0!==0?X6/Z0:0,U6=Z0!==0?Math.atan2($,J):0,FJ=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",K6||1),A(Y,"rotate",G0(U6,"rad"),"deg"),Math.abs(FJ)>0.000001)A(Y,"skewX",G0(FJ,"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,o0=q/I,AJ=G/K,_6=z/K,Y6=W/K,s0=Math.sqrt(F*F+O*O),H6=s0<0.000001,i0=0,n0=0,a0=0;if(!H6)i0=Math.atan2(_6,Y6),n0=Math.atan2(-AJ,s0),a0=Math.atan2(O,F);else i0=Math.atan2(-o0,P),n0=Math.atan2(-AJ,s0),a0=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(i0,"rad"),"deg"),A(Y,"rotateY",G0(n0,"rad"),"deg"),A(Y,"rotateZ",G0(a0,"rad"),"deg")}function E6(J,$){if(!J||J==="none")return;if(typeof DOMMatrixReadOnly<"u"){let Z=new DOMMatrixReadOnly(J);t0(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);t0(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);t0(Z[0],Z[1],0,Z[2],Z[3],0,0,0,1,Z[4],Z[5],0,!0,$)}}function b6(J,$){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let Z=J.style.transform;if(Z&&Z!=="none"){R6(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")E6(q,$),$.cachedString=q}}catch{}}function EJ(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:[...RJ],dirty:0,used:0,cachedString:"",pinDirty:!1},b6(J,$),z0.set(J,$)}return $}function y(J,$,Q,Z){let j=EJ(J),q=JJ[$];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 $J(J,$){let Q=EJ(J),Z=JJ[$];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 e0(J){return J===0?"0":`${Math.round(J)}px`}function DJ(J,$,Q){return`translate3d(${e0(J)}, ${e0($)}, ${e0(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 DJ(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=DJ(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 QJ=new Set,b0=new Map,x0=!1;function C0(J){QJ.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 ZJ(){if(!x0)return;for(let J of QJ){let $=J;if($.style){let Q=R(J);$.style.transform=Q}}QJ.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 jJ(J){if(j0){J();return}j0=!0;try{J(),ZJ()}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{ZJ()}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,x6=100,s=new Map;function C6(J){let $=s.get(J);if($!==void 0)s.delete(J),s.set(J,$);return $}function V6(J,$){if(s.has(J))s.delete(J);while(s.size>=x6){let Q=s.keys().next().value;if(Q!==void 0)s.delete(Q);else break}s.set(J,$)}function w6(J){return/^\s*[Mm]/.test(J)}function bJ(){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 xJ(J){if(J instanceof Element)return J.getAttribute("d");if(typeof J==="string"){if(w6(J))return J;if(typeof document<"u"){let $=document.querySelector(J);if($)return $.getAttribute("d")}}return null}function CJ(J){let $=C6(J);if($!==void 0)return $;try{let Q=bJ();Q.setAttribute("d",J);let Z=Q.getTotalLength();return V6(J,Z),Z}catch{return 0}}function qJ(J,$,Q=!1){try{let Z=bJ();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=P6(Z,G,j);return{x:z.x,y:z.y,angle:W}}catch{return{x:0,y:0,angle:0}}}function P6(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 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 Z=Q.getBoundingClientRect(),j=Z.width*$[0]/100,q=Z.height*$[1]/100;return{x:j,y:q}}function wJ(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=qJ($,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 PJ(){if(i&&i.parentNode)i.parentNode.removeChild(i);i=null,B0=null,s.clear()}var S6=new Set(["perspective","x","y","z","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skewX","skewY"]),y6=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"]),v6=new Set(["rotate","rotateX","rotateY","rotateZ","skewX","skewY"]),h6=new Set(["opacity","scale","scaleX","scaleY","scaleZ","z-index","zIndex"]),T6=new Set(["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor","textDecorationColor","caretColor","fill","stroke"]),f6=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 S6.has(J)}function q0(J){return T6.has(J)}function r(J){return J==="filter"}function GJ(J){return J==="drawSVG"}function zJ(J){return J==="path"}function t(J){return J.startsWith("--")}function SJ(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 f6.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(h6.has(J))return"";if(v6.has(J))return"deg";if(y6.has(J))return"px";return""}function vJ(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 u6($)}if(h($))return $J(J,$);try{if(typeof window<"u"&&window.getComputedStyle){let Z=window.getComputedStyle(J).getPropertyValue(n($));if(Z)return V(Z).value}}catch(Q){}return vJ($)}function hJ(J,$){let Q=J,Z=n($);if(h($)){let j=Q.style.transform;v(J),Q.style.transform="";let q=$J(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:vJ($),unit:g($)}}function u6(J){if(J.startsWith("scale"))return 1;return 0}function n(J){return J.replace(/[A-Z]/g,($)=>`-${$.toLowerCase()}`)}function d6(J){if(typeof J==="string")return/^[+\-*/]=/.test(J);return!1}function p6(J){let $=J.match(/^([+\-*/])=/);return $?$[0]:null}function c6(J,$,Q){switch(Q){case"+=":return J+$;case"-=":return J-$;case"*=":return J*$;case"/=":return $!==0?J/$:J;default:return $}}function m6(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 g6(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 l6(J,$,Q,Z){if(SJ(Q)||Z!==void 0&&SJ(Z)){let W=U.color;if(W){let N=String(Q),B=W.parseColor(N,J),_=Z!==void 0?W.parseColor(String(Z),J):o6(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=yJ(J,$),z=W.unit}else{let W=V(Q);q=yJ(J,$),G=W.value,z=W.unit}return{type:"scalar",property:$,isTransform:!1,startValue:q,endValue:G,unit:z}}function o6(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 yJ(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 s6(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 i6(J,$,Q,Z){let j=Q,q=Z,G=j?.target?j:q;if(!G?.target)return null;let z=xJ(G.target);if(!z)return null;let W=CJ(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=VJ(J,X),H=j?.align??q?.align,I=wJ(H,z,J);return{type:"path",property:$,isTransform:!1,pathData:z,pathLength:W,startProgress:N,endProgress:B,rotate:_,alignOffset:Y,pathOffset:I}}function TJ(J,$,Q,Z){let j=J instanceof Element;if(j&&t($))return l6(J,$,Q,Z);if(j&&q0($)){let B=m6(J,$,Q,Z);if(B)return B}if(j&&r($)){let B=g6(J,$,Q,Z);if(B)return B}if(j&&GJ($)){let B=s6(J,$,Q,Z);if(B)return B}if(j&&zJ($)){let B=i6(J,$,Q,Z);if(B)return B}let q=h($),G=Z===void 0&&d6(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=p6(Q),_=p(J,$),X=V(Q);z=_,W=c6(_,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 fJ(){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 WJ=fJ(),w0=new WeakMap,NJ=fJ();function uJ(J){if(h(J))return["transform"];if(r(J))return["filter"];if(GJ(J))return["strokeDasharray","strokeDashoffset"];return[J]}function n6(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=uJ($);for(let Z of Q)WJ.register(J,Z)}function a6(J,$){for(let Q of $)n6(J,Q)}function r6(J){WJ.clearRegistry(J),w0.delete(J)}function t6(J,$){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let Q=new Set;for(let Z of $)for(let j of uJ(Z))Q.add(j);for(let Z of Q)if(t(Z))J.style.removeProperty(Z);else J.style[Z]=""}function e6(J){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let $=WJ.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 J7(J){e6(J),r6(J)}function I0(J,$){NJ.registerMany(J,$)}function BJ(J){NJ.clearRegistry(J)}function $7(J){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let $=NJ.get(J);if(!$||$.size===0)return;for(let Q of $)J.style[Q]=""}function Q7(J){$7(J),BJ(J)}U.styleReset={registerAnimatedProps:a6,clearAnimationStylesForProps:t6,clearAnimationStylesAndUnregister:J7,clearPinStylesAndUnregister:Q7};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: ${
|
|
3
|
-
${
|
|
1
|
+
var{defineProperty:r0,getOwnPropertyNames:F6,getOwnPropertyDescriptor:O6}=Object,A6=Object.prototype.hasOwnProperty;function L6(J){return this[J]}var M6=(J)=>{var $=(AJ??=new WeakMap).get(J),Q;if($)return $;if($=r0({},"__esModule",{value:!0}),J&&typeof J==="object"||typeof J==="function"){for(var Z of F6(J))if(!A6.call($,Z))r0($,Z,{get:L6.bind(J,Z),enumerable:!(Q=O6(J,Z))||Q.enumerable})}return AJ.set(J,$),$},AJ;var k6=(J)=>J;function D6(J,$){this[J]=k6.bind(null,$)}var R6=(J,$)=>{for(var Q in $)r0(J,Q,{get:$[Q],enumerable:!0,configurable:!0,set:D6.bind($,Q)})};var o7={};R6(o7,{Types:()=>Y6,Timeline:()=>E,MotionUtils:()=>l0,Motion:()=>_6});module.exports=M6(o7);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 A{static _instance;static _triggerRegistry=new Map;static _pageLoadTriggerFactory=null;static _RESIZE_DEBOUNCE_MS=200;static _BODY_RESIZE_DEBOUNCE_MS=250;_pageLoadTrigger=null;_scrollTriggers=new Map;_eventTriggers=new Map;_mouseMoveTriggers=new Map;_gestureTriggers=new Map;_cursorTriggers=new Map;_pageExitTriggers=new Map;_resizeHandler=null;_resizeTimer=null;_bodyResizeObserver=null;_lastBodyHeight=0;_bodyResizeTimer=null;get _allTriggerMaps(){return[this._scrollTriggers,this._eventTriggers,this._mouseMoveTriggers,this._gestureTriggers,this._cursorTriggers,this._pageExitTriggers]}constructor(){}static getInstance(){if(!A._instance)A._instance=new A;return A._instance}static registerTrigger(J,$){A._triggerRegistry.set(J,$)}static registerPageLoadTrigger(J){A._pageLoadTriggerFactory=J}_getPageLoadTrigger(){if(!this._pageLoadTrigger&&A._pageLoadTriggerFactory)this._pageLoadTrigger=new A._pageLoadTriggerFactory;return this._pageLoadTrigger}_createTrigger(J,...$){let Q=A._triggerRegistry.get(J);if(!Q){let Z=Array.from(A._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()},A._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}_attachBodyResizeObserver(){if(this._bodyResizeObserver)return;if(typeof window>"u"||typeof document>"u")return;if(typeof ResizeObserver>"u")return;this._lastBodyHeight=document.body.offsetHeight,this._bodyResizeObserver=new ResizeObserver((J)=>{for(let $ of J){let Q=$.borderBoxSize?.[0]?$.borderBoxSize[0].blockSize:$.contentRect.height;if(Math.abs(Q-this._lastBodyHeight)<1)continue;if(this._lastBodyHeight=Q,this._bodyResizeTimer!==null)clearTimeout(this._bodyResizeTimer);this._bodyResizeTimer=setTimeout(()=>{this._bodyResizeTimer=null,this.refreshScrollTriggers()},A._BODY_RESIZE_DEBOUNCE_MS)}}),this._bodyResizeObserver.observe(document.body)}_detachBodyResizeObserver(){if(!this._bodyResizeObserver)return;if(this._bodyResizeObserver.disconnect(),this._bodyResizeObserver=null,this._bodyResizeTimer!==null)clearTimeout(this._bodyResizeTimer),this._bodyResizeTimer=null;this._lastBodyHeight=0}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(),this._attachBodyResizeObserver()}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(),this._detachBodyResizeObserver()}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(),this._detachBodyResizeObserver()}static _reset(){if(A._instance){if(A._instance._pageLoadTrigger)A._instance._pageLoadTrigger._reset();A._instance.killAll(),A._instance=void 0}}}U.triggerManager={getInstance:A.getInstance};function MJ(J){if(typeof document>"u"){J();return}if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",J,{once:!0});else J()}function LJ(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(LJ(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(LJ(J[0]))return J;return J}if(J&&typeof J==="object"&&"length"in J)return Array.from(J);return[]}class d{_timeline;_config;_enabled=!1;constructor(J,$){this._timeline=J,this._config=$}enable(){if(this._enabled)return;this._enabled=!0,MJ(()=>{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 c(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 kJ extends d{_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,c(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)}}A.registerTrigger("event",kJ);var JJ={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},RJ=["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 F(J,$,Q,Z){let j=JJ[$];if(j===void 0)return;J.values[j]=Q;let q=Z&&Z.length>0?Z:RJ[j]||"";J.units[j]=q,J.used|=1<<j}function E6(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:""};F($,"x",G.value,G.unit),F($,"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:""};F($,"x",G.value,G.unit),F($,"y",z.value,z.unit),F($,"z",W.value,W.unit);break}case"translateX":{let G=q[0]?o(q[0]):{value:0,unit:""};F($,"x",G.value,G.unit);break}case"translateY":{let G=q[0]?o(q[0]):{value:0,unit:""};F($,"y",G.value,G.unit);break}case"translateZ":{let G=q[0]?o(q[0]):{value:0,unit:""};F($,"z",G.value,G.unit);break}case"scale":{let G=q[0]?parseFloat(q[0]):1,z=q[1]?parseFloat(q[1]):G;F($,"scaleX",G),F($,"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;F($,"scaleX",G),F($,"scaleY",z),F($,"scaleZ",W);break}case"scaleX":{let G=q[0]?parseFloat(q[0]):1;F($,"scaleX",G);break}case"scaleY":{let G=q[0]?parseFloat(q[0]):1;F($,"scaleY",G);break}case"scaleZ":{let G=q[0]?parseFloat(q[0]):1;F($,"scaleZ",G);break}case"rotate":F($,"rotate",q[0]?e(q[0]):0,"deg");break;case"rotateX":F($,"rotateX",q[0]?e(q[0]):0,"deg");break;case"rotateY":F($,"rotateY",q[0]?e(q[0]):0,"deg");break;case"rotateZ":F($,"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;F($,"skewX",G,"deg"),F($,"skewY",z,"deg");break}case"skewX":F($,"skewX",q[0]?e(q[0]):0,"deg");break;case"skewY":F($,"skewY",q[0]?e(q[0]):0,"deg");break;case"perspective":{let G=q[0]?o(q[0]):{value:0,unit:""};F($,"perspective",G.value,G.unit);break}default:break}}}function t0(J,$,Q,Z,j,q,G,z,W,N,_,Y,X,B){if(X){let Z0=Math.hypot(J,$),K6=J*j-$*Z,U6=Z0!==0?K6/Z0:0,I6=Z0!==0?Math.atan2($,J):0,OJ=Z0!==0?Math.atan2(J*Z+$*j,Z0*Z0):0;if(F(B,"x",N,"px"),F(B,"y",_,"px"),F(B,"scaleX",Z0||1),F(B,"scaleY",U6||1),F(B,"rotate",G0(I6,"rad"),"deg"),Math.abs(OJ)>0.000001)F(B,"skewX",G0(OJ,"rad"),"deg");return}let H=Math.hypot(J,$,Q)||1,I=Math.hypot(Z,j,q)||1,K=Math.hypot(G,z,W)||1,O=J/H,M=$/H,k=Q/H,L=Z/I,P=j/I,o0=q/I,FJ=G/K,B6=z/K,H6=W/K,s0=Math.sqrt(O*O+L*L),X6=s0<0.000001,i0=0,n0=0,a0=0;if(!X6)i0=Math.atan2(B6,H6),n0=Math.atan2(-FJ,s0),a0=Math.atan2(L,O);else i0=Math.atan2(-o0,P),n0=Math.atan2(-FJ,s0),a0=0;F(B,"x",N,"px"),F(B,"y",_,"px"),F(B,"z",Y,"px"),F(B,"scaleX",H),F(B,"scaleY",I),F(B,"scaleZ",K),F(B,"rotateX",G0(i0,"rad"),"deg"),F(B,"rotateY",G0(n0,"rad"),"deg"),F(B,"rotateZ",G0(a0,"rad"),"deg")}function b6(J,$){if(!J||J==="none")return;if(typeof DOMMatrixReadOnly<"u"){let Z=new DOMMatrixReadOnly(J);t0(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);t0(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);t0(Z[0],Z[1],0,Z[2],Z[3],0,0,0,1,Z[4],Z[5],0,!0,$)}}function C6(J,$){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let Z=J.style.transform;if(Z&&Z!=="none"){E6(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")b6(q,$),$.cachedString=q}}catch{}}function EJ(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:[...RJ],dirty:0,used:0,cachedString:"",pinDirty:!1},C6(J,$),z0.set(J,$)}return $}function y(J,$,Q,Z){let j=EJ(J),q=JJ[$];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 $J(J,$){let Q=EJ(J),Z=JJ[$];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 e0(J){return J===0?"0":`${Math.round(J)}px`}function DJ(J,$,Q){return`translate3d(${e0(J)}, ${e0($)}, ${e0(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 DJ(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 L=j[0];D.push(`perspective(${G}${L})`)}let z=Z[1],W=Z[2],N=Z[3],_=j[1],Y=j[2],X=j[3],B=q&2,H=q&4,I=q&8;if(z!==0||W!==0||N!==0||B||H||I){let L=_===Y&&(N===0&&!I||Y===X);if(N!==0||I)if(L)D.push(`translate3d(${z}${_}, ${W}${Y}, ${N}${X})`);else{if(z!==0||B)D.push(`translateX(${z}${_})`);if(W!==0||H)D.push(`translateY(${W}${Y})`);D.push(`translateZ(${N}${X})`)}else if(L&&(z!==0||B)&&(W!==0||H))D.push(`translate(${z}${_}, ${W}${Y})`);else{if(z!==0||B)D.push(`translateX(${z}${_})`);if(W!==0||H)D.push(`translateY(${W}${Y})`)}}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,O=q&512,M=q&1024;if(Z[8]!==1||K)D.push(`scale(${Z[8]})`);else if(Z[9]!==1||Z[10]!==1||O||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 L=DJ(Q.x,Q.y,Q.z);$.cachedString=k?`${L} ${k}`:L}else $.cachedString=k;return $.dirty=0,$.pinDirty=!1,$.cachedString}function v(J,$=!1){if(z0.delete(J),$&&J instanceof HTMLElement)J.style.transform=""}var QJ=new Set,b0=new Map,C0=!1;function V0(J){QJ.add(J),C0=!0}function x0(J,$,Q){let Z=b0.get(J);if(!Z)Z=new Map,b0.set(J,Z);Z.set($,Q),C0=!0}function ZJ(){if(!C0)return;for(let J of QJ){let $=J;if($.style){let Q=R(J);$.style.transform=Q}}QJ.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(),C0=!1}var j0=!1;function N0(){return j0}function jJ(J){if(j0){J();return}j0=!0;try{J(),ZJ()}finally{j0=!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((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{ZJ()}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,_0=null,V6=100,s=new Map;function x6(J){let $=s.get(J);if($!==void 0)s.delete(J),s.set(J,$);return $}function w6(J,$){if(s.has(J))s.delete(J);while(s.size>=V6){let Q=s.keys().next().value;if(Q!==void 0)s.delete(Q);else break}s.set(J,$)}function P6(J){return/^\s*[Mm]/.test(J)}function bJ(){if(_0)return _0;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"),_0=document.createElementNS("http://www.w3.org/2000/svg","path"),i.appendChild(_0),document.body.appendChild(i),_0}function CJ(J){if(J instanceof Element)return J.getAttribute("d");if(typeof J==="string"){if(P6(J))return J;if(typeof document<"u"){let $=document.querySelector(J);if($)return $.getAttribute("d")}}return null}function VJ(J){let $=x6(J);if($!==void 0)return $;try{let Q=bJ();Q.setAttribute("d",J);let Z=Q.getTotalLength();return w6(J,Z),Z}catch{return 0}}function qJ(J,$,Q=!1){try{let Z=bJ();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=S6(Z,G,j);return{x:z.x,y:z.y,angle:W}}catch{return{x:0,y:0,angle:0}}}function S6(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 wJ(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=qJ($,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),_=W.top+W.height/2-(z.top+z.height/2);return{x:N-j.x,y:_-j.y}}return{x:-j.x,y:-j.y}}function PJ(){if(i&&i.parentNode)i.parentNode.removeChild(i);i=null,_0=null,s.clear()}var y6=new Set(["perspective","x","y","z","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skewX","skewY"]),v6=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"]),T6=new Set(["rotate","rotateX","rotateY","rotateZ","skewX","skewY"]),h6=new Set(["opacity","scale","scaleX","scaleY","scaleZ","z-index","zIndex"]),f6=new Set(["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor","textDecorationColor","caretColor","fill","stroke"]),u6=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 T(J){return y6.has(J)}function q0(J){return f6.has(J)}function r(J){return J==="filter"}function GJ(J){return J==="drawSVG"}function zJ(J){return J==="path"}function t(J){return J.startsWith("--")}function SJ(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 u6.has($)}function x(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(h6.has(J))return"";if(T6.has(J))return"deg";if(v6.has(J))return"px";return""}function vJ(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 d6($)}if(T($))return $J(J,$);try{if(typeof window<"u"&&window.getComputedStyle){let Z=window.getComputedStyle(J).getPropertyValue(n($));if(Z)return x(Z).value}}catch(Q){}return vJ($)}function TJ(J,$){let Q=J,Z=n($);if(T($)){let j=Q.style.transform;v(J),Q.style.transform="";let q=$J(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=x(G);return{value:z.value,unit:z.unit}}}}catch(j){}return{value:vJ($),unit:g($)}}function d6(J){if(J.startsWith("scale"))return 1;return 0}function n(J){return J.replace(/[A-Z]/g,($)=>`-${$.toLowerCase()}`)}function c6(J){if(typeof J==="string")return/^[+\-*/]=/.test(J);return!1}function p6(J){let $=J.match(/^([+\-*/])=/);return $?$[0]:null}function m6(J,$,Q){switch(Q){case"+=":return J+$;case"-=":return J-$;case"*=":return J*$;case"/=":return $!==0?J/$:J;default:return $}}function g6(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 l6(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 o6(J,$,Q,Z){if(SJ(Q)||Z!==void 0&&SJ(Z)){let W=U.color;if(W){let N=String(Q),_=W.parseColor(N,J),Y=Z!==void 0?W.parseColor(String(Z),J):s6(J,$);return{type:"color",property:$,isTransform:!1,startColor:Y||new Float32Array([0,0,0,1]),endColor:_||new Float32Array([0,0,0,1])}}}let q,G,z;if(Z!==void 0&&Q!==void 0){let W=x(Z),N=x(Q);q=W.value,G=N.value,z=N.unit||W.unit}else if(Z!==void 0){let W=x(Z);q=W.value,G=yJ(J,$),z=W.unit}else{let W=x(Q);q=yJ(J,$),G=W.value,z=W.unit}return{type:"scalar",property:$,isTransform:!1,startValue:q,endValue:G,unit:z}}function s6(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 yJ(J,$){try{if(typeof window<"u"&&window.getComputedStyle){let Z=window.getComputedStyle(J).getPropertyValue($).trim();if(Z)return x(Z).value}}catch{}return 0}function i6(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 n6(J,$,Q,Z){let j=Q,q=Z,G=j?.target?j:q;if(!G?.target)return null;let z=CJ(G.target);if(!z)return null;let W=VJ(z);if(W===0)return null;let N,_;if(j?.target&&q?.target)N=q.start??0,_=j.end??1;else if(j?.target)N=j.start??0,_=j.end??1;else N=q.start??0,_=q.end??1;let Y=j?.rotate??q?.rotate??!1,X=j?.alignAt??q?.alignAt??[50,50],B=xJ(J,X),H=j?.align??q?.align,I=wJ(H,z,J);return{type:"path",property:$,isTransform:!1,pathData:z,pathLength:W,startProgress:N,endProgress:_,rotate:Y,alignOffset:B,pathOffset:I}}function hJ(J,$,Q,Z){let j=J instanceof Element;if(j&&t($))return o6(J,$,Q,Z);if(j&&q0($)){let _=g6(J,$,Q,Z);if(_)return _}if(j&&r($)){let _=l6(J,$,Q,Z);if(_)return _}if(j&&GJ($)){let _=i6(J,$,Q,Z);if(_)return _}if(j&&zJ($)){let _=n6(J,$,Q,Z);if(_)return _}let q=T($),G=Z===void 0&&c6(Q),z,W,N;if(Z!==void 0){let _=x(Z);if(Q!==void 0){let Y=x(Q);z=_.value,W=Y.value,N=Y.unit||_.unit||g($)}else z=_.value,W=p(J,$),N=_.unit||g($)}else if(G){let _=p6(Q),Y=p(J,$),X=x(Q);z=Y,W=m6(Y,X.value,_),N=X.unit||g($)}else{let _=p(J,$),Y=x(Q);z=_,W=Y.value,N=Y.unit||g($)}return{type:"scalar",property:$,isTransform:q,startValue:z,endValue:W,unit:N}}function fJ(){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 WJ=fJ(),w0=new WeakMap,NJ=fJ();function uJ(J){if(T(J))return["transform"];if(r(J))return["filter"];if(GJ(J))return["strokeDasharray","strokeDashoffset"];return[J]}function a6(J,$){if(T($)&&!w0.has(J)){if(J instanceof HTMLElement||J instanceof SVGElement){let Z=J.style.transform;w0.set(J,Z||null)}}let Q=uJ($);for(let Z of Q)WJ.register(J,Z)}function r6(J,$){for(let Q of $)a6(J,Q)}function t6(J){WJ.clearRegistry(J),w0.delete(J)}function e6(J,$){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let Q=new Set;for(let Z of $)for(let j of uJ(Z))Q.add(j);for(let Z of Q)if(t(Z))J.style.removeProperty(Z);else J.style[Z]=""}function J7(J){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let $=WJ.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 $7(J){J7(J),t6(J)}function I0(J,$){NJ.registerMany(J,$)}function _J(J){NJ.clearRegistry(J)}function Q7(J){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let $=NJ.get(J);if(!$||$.size===0)return;for(let Q of $)J.style[Q]=""}function Z7(J){Q7(J),_J(J)}U.styleReset={registerAnimatedProps:r6,clearAnimationStylesForProps:e6,clearAnimationStylesAndUnregister:$7,clearPinStylesAndUnregister:Z7};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 _=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 Y=this._resolvePinSpacing(),X=window.getComputedStyle(J),B=X.display,H=X.flexDirection,I=z&&this._spacer?.parentElement?this._spacer.parentElement:J.parentElement,K=I?/^(inline-)?flex$/.test(getComputedStyle(I).display):!1,O=/^(inline-)?flex$/.test(B),M=`
|
|
2
|
+
display: ${B};
|
|
3
|
+
${O?`flex-direction: ${H};`:""}
|
|
4
4
|
box-sizing: content-box;
|
|
5
5
|
width: ${N.width}px;
|
|
6
6
|
height: ${N.height}px;
|
|
7
|
-
margin-top: ${
|
|
8
|
-
margin-left: ${
|
|
9
|
-
margin-right: ${
|
|
7
|
+
margin-top: ${_.marginTop};
|
|
8
|
+
margin-left: ${_.marginLeft};
|
|
9
|
+
margin-right: ${_.marginRight};
|
|
10
10
|
overflow: visible;
|
|
11
11
|
${K?"flex-shrink: 0;":""}
|
|
12
|
-
`;if(
|
|
12
|
+
`;if(Y==="padding")M+=`padding-bottom: ${this._pinDistance}px;`,M+=`margin-bottom: ${_.marginBottom};`;else if(Y==="margin"){let L=parseFloat(_.marginBottom)||0,P=z?L-G:L;M+=`margin-bottom: ${P+this._pinDistance}px;`}else M+=`margin-bottom: ${_.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="",_J(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 h(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]),_=q[4]||"px",Y=0;switch(z){case"top":Y=0;break;case"center":Y=$/2;break;case"bottom":Y=$;break}let X=dJ(N,_,$,Q,Z);return Y+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 dJ(z,W,$,Q,Z)}return 0}function dJ(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 YJ{_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=h(z[1]||"top",G,G),N=this._endConfig.startsWith("+=")?W:h(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 _=(I,K,O)=>{let M=document.createElement("div");M.setAttribute("data-marker",I),M.style.cssText=`
|
|
13
13
|
position: absolute;
|
|
14
|
-
${
|
|
14
|
+
${O}: 0;
|
|
15
15
|
height: 1px;
|
|
16
16
|
width: 50px;
|
|
17
17
|
background: ${K};
|
|
18
18
|
pointer-events: none;
|
|
19
19
|
`;let k=document.createElement("span");return k.textContent=I,k.style.cssText=`
|
|
20
20
|
position: absolute;
|
|
21
|
-
${
|
|
21
|
+
${O}: 0;
|
|
22
22
|
top: 2px;
|
|
23
23
|
background: ${K};
|
|
24
24
|
color: ${K==="lime"?"#000":"#fff"};
|
|
@@ -28,7 +28,7 @@ var{defineProperty:r0,getOwnPropertyNames:I6,getOwnPropertyDescriptor:A6}=Object
|
|
|
28
28
|
white-space: nowrap;
|
|
29
29
|
border-radius: 2px;
|
|
30
30
|
line-height: 1.2;
|
|
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 _J(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,jJ(()=>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;jJ(()=>{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 pJ{_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(pJ);class cJ 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",cJ);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 mJ(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 gJ(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 lJ(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 oJ(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=Z7(_.angle,X.angle,B);y(J,"rotate",F,"deg")}if(N0())C0(J);else J.style.transform=R(J)}function Z7(J,$,Q){let Z=$-J;if(Z>180)Z-=360;if(Z<-180)Z+=360;return J+Z*Q}var YJ=null,j7=100,q7=500,G7=0.5,F0=[],z7=50;function W7(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 N7(J){if(F0.length<z7)F0.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,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(q7,Math.max(j7,Math.ceil(B*G7)));this.pathLUT=W7(_+1);for(let X=0;X<=_;X++){let Y=X/_,H=j+(q-j)*Y;this.pathLUT[X]=qJ(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)gJ(this.target,this.property,$,Q,Z,j)}else if(this.valueType==="filter"&&this.startFilters&&this.endFilters){if(this._isElement)lJ(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(YJ||(YJ=U.drawSVG))YJ.applyDrawSVG(this.target,$,Q,this.pathLength)}}else if(this.valueType==="path"&&this.pathLUT&&this.pathLUT.length>0){if(this._isElement)oJ(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)mJ(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)N7(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 HJ,500),J0={acquire:()=>L0.acquire(),release:(J)=>L0.release(J),getPoolSize:()=>L0.getPoolSize(),getTotalCreated:()=>L0.getTotalCreated(),clear:()=>L0.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 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 sJ)J[q]=sJ[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 E{static _eachCounter=0;static _registerWithEngine=null;static setEngineRegisterCallback(J){E._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&&E._registerWithEngine)E._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)||zJ(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=hJ(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_${$}_${E._eachCounter++}`,j=new E(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_${$}_${E._eachCounter++}`,j=new E(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 B7=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 _7(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"&&!B7.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 E;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 E;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||!_7(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 iJ 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",iJ);var XJ=null;function Y7(){if(!XJ&&typeof document<"u"){let J=document.createElement("canvas");J.width=1,J.height=1,XJ=J.getContext("2d")}return XJ}function nJ(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 H7(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 X7(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 K7(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]=X7(Q,Z,j);return new Float32Array([G,z,W,q])}function U7(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 KJ(j,$)}function I7(J){let $=Y7();if(!$)return null;$.fillStyle="#000000",$.fillStyle=J;let Q=$.fillStyle;if(Q==="#000000"&&J.toLowerCase()!=="black"&&J!=="#000000"&&J!=="#000")return null;return nJ(Q)}function KJ(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 nJ(Q);if(Q.startsWith("rgb"))return H7(Q);if(Q.startsWith("hsl"))return K7(Q);if(Q.startsWith("var("))return U7(Q,$);return I7(Q)}function A7(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 KJ(j,J)||new Float32Array([0,0,0,1])}U.color={parseColor:KJ,getCurrentColor:A7};var aJ={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 F7(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 rJ(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=F7(j[0]);if(q)Q.push(q)}return Q.length>0?Q:null}function O7(J){let $=aJ[J.name];if(!$)return!1;return J.value===$.value}function L7(J){if(!J||J.length===0)return"none";if(J.every(O7))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 M7(J){if(typeof window>"u")return[];let $=window.getComputedStyle(J),Q=$.filter||$.getPropertyValue("filter");if(!Q||Q==="none")return[];return rJ(Q)||[]}function k7(J){let $=aJ[J];if($)return{name:J,value:$.value,unit:$.unit};return{name:J,value:0,unit:""}}function D7(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=k7(q);Z.push(G||W),j.push(z||W)}return{start:Z,end:j}}var Y0=[];function R7(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:rJ,getCurrentFilter:M7,mergeFilterArrays:D7,interpolateFilters:R7,filterToString:L7};var tJ=new WeakMap;function E7(J){return"getTotalLength"in J&&typeof J.getTotalLength==="function"}function v0(J){let $=tJ.get(J);if($!==void 0)return $;if(E7(J)){let Q=J.getTotalLength();return tJ.set(J,Q),Q}return 0}function b7(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=UJ(q,G,N),_=UJ(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:UJ(q,G,z)}}}return null}function UJ(J,$,Q){if($==="px"&&Q>0)return J/Q;return J/100}function x7(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 C7(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:b7,getCurrentDrawSVG:x7,getPathLength:v0,applyDrawSVG:C7};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 o0 of M)P+=`<span data-split-char data-char-index="${X}" style="display:inline-block">${this._escapeHtml(o0)}</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 eJ{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,$)=>eJ.resolve(J,$)};function V7(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 w7(J,$,Q,Z){let{absolute:j=!1,scale:q=!0,resize:G=!1}=Q;if($ instanceof HTMLElement)v($,!1);let z=V7($,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 P7(J,$,Q,Z){J.setPendingFitSetup((G)=>w7(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:P7};var Z6=(J)=>J,S7=Z6,b={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 j6=(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=j6();var q6=(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=q6(),J6=(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-J6(1-J),out:J6,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}},$6={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}},y7={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)},Q6={linear:Z6,none:S7,power1:b.out,"power1.in":b.in,"power1.out":b.out,"power1.inout":b.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:b.out,"quad.in":b.in,"quad.out":b.out,"quad.inout":b.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:$6.inOut,"slow.in":b.out,"slow.out":b.out,"slow.inout":b.out,slowmo:$6.inOut,"slowmo.in":b.out,"slowmo.out":b.out,"slowmo.inout":b.out,rough:y7.inOut,"rough.in":b.out,"rough.out":b.out,"rough.inout":b.out,steps:c0.inOut,"steps.in":c0.in,"steps.out":c0.out,"steps.inout":c0.inOut},v7={back:(J)=>j6(J),elastic:(J,$)=>q6(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:$}}},h7=/^(\w+)(?:\.(\w+))?\(([^)]*)\)$/;function G6(J){let $=J.toLowerCase();if(Q6[$])return Q6[$];let Q=h7.exec($);if(Q){let[,Z,j,q]=Q,G=v7[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)`),b.out}class IJ{_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=G6(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 IJ,100),z6={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=z6,this.propTweenPool=J0,this.ticker.add(this.update,0)}static getInstance(){if(!x.instance)x.instance=new x,E.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=W6(Q),G=j?W6(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=TJ(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 E(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(),PJ()}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 W6(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 T7(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 f7(J,$,Q){if(Q===void 0)return(Z)=>Math.min($,Math.max(J,Z));return Math.min($,Math.max(J,Q))}function u7(J,$,Q){let Z=J+Math.random()*($-J);if(Q&&Q>0)return Math.round(Z/Q)*Q;return Z}function d7(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 p7(J,$,Q){return J+($-J)*Q}function c7(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 m7(J,$,Q){let Z=(j)=>(j-J)/($-J);if(Q===void 0)return Z;return Z(Q)}function g7(J,$,Q){let Z=$-J,j=(q)=>{return((q-J)%Z+Z)%Z+J};if(Q===void 0)return j;return j(Q)}var l0={toArray:T7,clamp:f7,random:u7,snap:d7,interpolate:p7,mapRange:c7,normalize:m7,wrap:g7};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 E;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=l0;var N6=l;var B6={};
|
|
31
|
+
`,M.appendChild(k),M},Y=_("scroller-start",Q,"right"),X=_("scroller-end",Z,"right"),B=_("start",Q,"left"),H=_("end",Z,"left");if(!this._triggerElement)B.style.display="none",H.style.display="none";if(this._markerContainer.appendChild(Y),this._markerContainer.appendChild(X),this._markerContainer.appendChild(B),this._markerContainer.appendChild(H),this._markers={scrollerStart:Y,scrollerEnd:X,elementStart:B,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 $=c(this._triggerElement),Q=h(this._startConfig.split(" ")[0]||"top",$.height,J),Z=this._endConfig.startsWith("+=")?Q:h(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 d{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()??c($),q;if(this._scroller instanceof Element){let B=this._scroller.getBoundingClientRect();q=j.top-B.top+Z}else q=j.top+Z;let z=this._defaultStart().split(" "),W=z[0]||"top",N=z[1]||"top",_=h(W,j.height,Q),Y=h(N,Q,Q);this._triggerStart=q+_-Y;let X=this._defaultEnd();if(X.startsWith("+=")){let B=h(X.slice(2),Q,Q);this._triggerEnd=this._triggerStart+B}else{let B=X.split(" "),H=B[0]||"bottom",I=B[1]||"top",K=h(H,j.height,Q),O=h(I,Q,Q);this._triggerEnd=q+K-O}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=h(j[0]||"top",J.getBoundingClientRect().height,q),W=h(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 YJ(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=h(Z[0]||"top",q,j),W=h(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,jJ(()=>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;jJ(()=>{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)},V.getInstance().add(this._scrubTickListener,a._SCRUB_TICKER_PRIORITY)}_stopSmoothScrollLoop(){if(this._scrubTickListener)V.getInstance().remove(this._scrubTickListener),this._scrubTickListener=null}}A.registerTrigger("scroll",a);class cJ{_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()}}A.registerPageLoadTrigger(cJ);class pJ extends d{_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 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,c(J))}_addTargetListeners(){this._targets.forEach((J)=>{this._frozenRects.set(J,c(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()},V.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)}}A.registerTrigger("mouseMove",pJ);class F0 extends d{_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,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=c(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=c(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 $=F0._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()}}A.registerTrigger("gesture",F0);var P0=null;function mJ(J,$,Q,Z){let j=J;if(!j.style)return;let q=N0();if(T($))if(y(J,$,Q,Z),q)V0(J);else j.style.transform=R(J);else{let G=Z?`${Q}${Z}`:`${Q}`;if(q)x0(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 gJ(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())x0(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 lJ(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())x0(J,"filter",G);else j.style.filter=G}}function oJ(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),_=z-W,Y=Z[W],X=Z[N],B=Y.x+(X.x-Y.x)*_,H=Y.y+(X.y-Y.y)*_,I=(q?.x??0)+B-(j?.x??0),K=(q?.y??0)+H-(j?.y??0);if(y(J,"x",I,"px"),y(J,"y",K,"px"),G){let O=j7(Y.angle,X.angle,_);y(J,"rotate",O,"deg")}if(N0())V0(J);else J.style.transform=R(J)}function j7(J,$,Q){let Z=$-J;if(Z>180)Z-=360;if(Z<-180)Z+=360;return J+Z*Q}var BJ=null,q7=100,G7=500,z7=0.5,O0=[],W7=50;function N7(J){for(let $=0;$<O0.length;$++)if(O0[$].length>=J){let Q=O0.splice($,1)[0];return Q.length=J,Q}return Array(J)}function _7(J){if(O0.length<W7)O0.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,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),_=Z*N,Y=Math.min(G7,Math.max(q7,Math.ceil(_*z7)));this.pathLUT=N7(Y+1);for(let X=0;X<=Y;X++){let B=X/Y,H=j+(q-j)*B;this.pathLUT[X]=qJ(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)gJ(this.target,this.property,$,Q,Z,j)}else if(this.valueType==="filter"&&this.startFilters&&this.endFilters){if(this._isElement)lJ(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)oJ(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)mJ(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)_7(this.pathLUT);this.pathLUT=null,this._isElement=!1}}class A0{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 A0(()=>new HJ,500),J0={acquire:()=>L0.acquire(),release:(J)=>L0.release(J),getPoolSize:()=>L0.getPoolSize(),getTotalCreated:()=>L0.getTotalCreated(),clear:()=>L0.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 f{static _createAnimationCallback=null;static setCreateAnimationCallback(J){f._createAnimationCallback=J}_targets;_originalTargets;_fromVars;_toVars;_setVars;_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.set)this._setVars=J.set;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._setVars&&!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,!f._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=f._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}if(this._built=!0,this._setVars&&Object.keys(this._setVars).length>0&&this._toVars&&!this._fromVars)this._fromVars={...this._setVars},this._setVars=void 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 sJ)J[q]=sJ[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=x(G).unit||g(q),N;for(let Y of this._targets)if(Y instanceof Element){if(t(q))try{let B=window.getComputedStyle(Y).getPropertyValue(q).trim();if(B)N=x(B).value}catch{}else N=p(Y,q);break}let _=N??0;J[q]=W?`${_}${W}`:`${_}`}}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(!f._createAnimationCallback)throw Error("AnimationBuilder: Engine not initialized. Call AnimationBuilder.setCreateAnimationCallback first.");let j=f._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];if(this._expectedAnimationIds=this._animations.map((q)=>q.getId()),this._setVars&&Object.keys(this._setVars).length>0&&f._createAnimationCallback){let q=f._createAnimationCallback(this._targets,{...this._setVars},0,0,"none",!1,void 0,{_skipInitialRender:this._skipInitialFromRender||void 0}),G=Array.isArray(q)?q:[q];this._animations=[...G,...this._animations],this._expectedAnimationIds=this._animations.map((z)=>z.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,setVars:this._setVars?{...this._setVars}: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 E{static _eachCounter=0;static _registerWithEngine=null;static setEngineRegisterCallback(J){E._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;_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&&E._registerWithEngine)E._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(T(Z)||zJ(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=TJ(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(T(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}_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}_addEntry(J,$,Q){let Z=S0.parse(Q,this._duration,this._previousStart,this._previousEnd),j=new f(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 Y of j.getTargets())if(Y instanceof HTMLElement&&!this._savedTransitions.has(Y))this._savedTransitions.set(Y,Y.style.transition);let N=!!J.getConfig().fromVars;if(G>0&&!N)j.setLazyStartCapture(!0);if(N)j.renderAtTime(0);if(J.hasSplit()){for(let Y of J.getOriginalTargets())if(Y instanceof Element){let X=Y;if(!this._splitParentOverrides.has(X))this._splitParentOverrides.set(X,X.style.opacity);X.style.opacity="1"}}let _=G+z;if(_>Z)Z=_}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_${$}_${E._eachCounter++}`,j=new E(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,_=G.builder.hasSplit(),Y=new f(J,{from:W.fromVars,to:W.toVars,set:W.setVars,duration:W.duration,delay:W.delay,ease:W.ease,repeat:N,..._&&W.split?{split:W.split}:{},..._&&W.mask?{mask:W.mask}:{},..._&&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)Y.setAxis(W.axis);j._addBuilder(Y,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_${$}_${E._eachCounter++}`,j=new E(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(),_=new f(J,{from:z.fromVars,to:z.toVars,set:z.setVars,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)_.setAxis(z.axis);j._addBuilder(_,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 _=W>0&&W<1;if(_)Z=z;if(Z===z){if(j(W,N),!_)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((_)=>G.some((Y)=>Y!==_&&Y.contains(_)))){let _=this._children.filter((Y)=>Y.type==="animation"&&Y.builder?.hasSplit()).map((Y)=>Y.builder);if(_.length>0)for(let Y of z)for(let X of _)U.textSplitter?.revert?.(Y,X);this._setupEachModeGeneric(z,(Y,X)=>{if(J==="scroll")Q.registerScroll(Y,{...j,target:X});else if(J==="hover")Q.registerHover(Y,{...j,target:X});else Q.registerClick(Y,{...j,target:X})});return}let N=this._children.filter((_)=>_.type==="animation"&&_.builder?.hasSplit()).map((_)=>_.builder);if(N.length>0)for(let _ of z)for(let Y of N)U.textSplitter?.revert?.(_,Y);this._clearTransitionData(),this._eachInstances=[];for(let _=0;_<G.length;_++){let Y=G[_],X=z.filter((H)=>Y.contains(H));if(X.length===0)continue;let B=this._createInstanceForElements(X,_);if(J==="scroll")Q.registerScroll(B,{...j,target:Y});else if(J==="hover")Q.registerHover(B,{...j,target:Y});else Q.registerClick(B,{...j,target:Y});this._eachInstances.push(B)}{let _=null,Y=this._onUpdate,X=this._onStart,B=this._onComplete;for(let H of this._eachInstances){if(Y)H.onUpdate((I,K)=>{let O=I>0&&I<1;if(O)_=H;if(_===H){if(Y(I,K),!O)_=null}});if(X)H.onStart(()=>{_=H,X()});if(B)H.onComplete(()=>{if(_===H)_=null,B()})}}this._eachDuration=this._duration;for(let _ of this._children)if(_.type==="animation"){let Y=_.child;Y.setTimelineChild(!1),Y.kill()}else if(_.type==="timeline")_.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._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();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._splitParentOverrides.clear(),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(T($)){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 Y7=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 B7(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 Y0 extends d{_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),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 Z=Y0._expandTransformShorthand(String(Q));for(let[j,q]of Object.entries(Z))y(this._innerElement,j,q)}else if(T($)){let Z=typeof Q==="number"?{value:Q,unit:g($)}:x(Q);y(this._innerElement,$,Z.value,Z.unit||g($)||void 0)}else{let Z=n($),j=typeof Q==="number"&&!Y7.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 E;Q._addEntry(this._innerElement,{to:Y0._expandStateProperties(J.properties),duration:J.duration,ease:J.ease}),this._stateTimelines.set("hover",Q)}let $=this._parsedStates.get("click");if($&&$.enabled){let Q=new E;Q._addEntry(this._innerElement,{to:Y0._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=Y0._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||!B7(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}}A.registerTrigger("cursor",Y0);class iJ extends d{_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}}A.registerTrigger("pageExit",iJ);var XJ=null;function H7(){if(!XJ&&typeof document<"u"){let J=document.createElement("canvas");J.width=1,J.height=1,XJ=J.getContext("2d")}return XJ}function nJ(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 X7(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 K7(J,$,Q){J=J/360,$=$/100,Q=Q/100;let Z,j,q;if($===0)Z=j=q=Q;else{let G=(N,_,Y)=>{if(Y<0)Y+=1;if(Y>1)Y-=1;if(Y<0.16666666666666666)return N+(_-N)*6*Y;if(Y<0.5)return _;if(Y<0.6666666666666666)return N+(_-N)*(0.6666666666666666-Y)*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 U7(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]=K7(Q,Z,j);return new Float32Array([G,z,W,q])}function I7(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 KJ(j,$)}function F7(J){let $=H7();if(!$)return null;$.fillStyle="#000000",$.fillStyle=J;let Q=$.fillStyle;if(Q==="#000000"&&J.toLowerCase()!=="black"&&J!=="#000000"&&J!=="#000")return null;return nJ(Q)}function KJ(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 nJ(Q);if(Q.startsWith("rgb"))return X7(Q);if(Q.startsWith("hsl"))return U7(Q);if(Q.startsWith("var("))return I7(Q,$);return F7(Q)}function O7(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 KJ(j,J)||new Float32Array([0,0,0,1])}U.color={parseColor:KJ,getCurrentColor:O7};var aJ={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 A7(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 rJ(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=A7(j[0]);if(q)Q.push(q)}return Q.length>0?Q:null}function L7(J){let $=aJ[J.name];if(!$)return!1;return J.value===$.value}function M7(J){if(!J||J.length===0)return"none";if(J.every(L7))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 k7(J){if(typeof window>"u")return[];let $=window.getComputedStyle(J),Q=$.filter||$.getPropertyValue("filter");if(!Q||Q==="none")return[];return rJ(Q)||[]}function D7(J){let $=aJ[J];if($)return{name:J,value:$.value,unit:$.unit};return{name:J,value:0,unit:""}}function R7(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=D7(q);Z.push(G||W),j.push(z||W)}return{start:Z,end:j}}var B0=[];function E7(J,$,Q){let Z=J.length;if(B0.length<Z)for(let j=B0.length;j<Z;j++)B0.push({name:"",value:0,unit:""});for(let j=0;j<Z;j++){let q=J[j],G=$[j],z=B0[j];z.name=q.name,z.value=q.value+(G.value-q.value)*Q,z.unit=q.unit||G.unit}return B0.length=Z,B0}U.filter={parseFilter:rJ,getCurrentFilter:k7,mergeFilterArrays:R7,interpolateFilters:E7,filterToString:M7};var tJ=new WeakMap;function b7(J){return"getTotalLength"in J&&typeof J.getTotalLength==="function"}function v0(J){let $=tJ.get(J);if($!==void 0)return $;if(b7(J)){let Q=J.getTotalLength();return tJ.set(J,Q),Q}return 0}function C7(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,_=UJ(q,G,N),Y=UJ(z,W,N);return{start:_,end:Y}}let j=Q.match(/^([-\d.]+)(px|%)?$/);if(j){let q=parseFloat(j[1]),G=j[2]||"%",z=$?v0($):0;return{start:0,end:UJ(q,G,z)}}}return null}function UJ(J,$,Q){if($==="px"&&Q>0)return J/Q;return J/100}function V7(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 x7(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:C7,getCurrentDrawSVG:V7,getPathLength:v0,applyDrawSVG:x7};var H0=new WeakMap;class T0{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 Y=this._tryUpgrade(J,j,$,Q);if(Y!==null)return Y;let X=$.split(",").map((B)=>B.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((Y)=>Y.trim()),W=z.includes("chars"),N=z.includes("words"),_=z.includes("lines");if(_)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(_)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((B)=>B.trim()),G=Q.split(",").map((B)=>B.trim()),z=G.includes("chars"),W=G.includes("words"),N=G.includes("lines"),_=q.includes("chars"),Y=q.includes("words"),X=q.includes("lines");if((!z||_)&&(!W||Y)&&(!N||X))return this._getSpansForType($.result,Q);if(N||X)return null;if(Y&&!_&&z){let B=[];for(let I of $.result.words)this._nestCharsInElement(I,B);$.result.chars=B,$.result.elements=B;let H=this._buildTypeString(q,G);if(J.setAttribute("data-split",H),Z?.mask)this._applyMaskWrappers($.result);return this._propagateGradientText(J,$.result),z?B:$.result.words.slice()}if(_&&!Y&&W){let B=Array.from(J.querySelectorAll("[data-split-word-wrap]")),H=[];for(let K=0;K<B.length;K++){let O=B[K];O.removeAttribute("data-split-word-wrap"),O.setAttribute("data-split-word",""),O.setAttribute("data-word-index",String(K)),H.push(O)}$.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 _=document.createElement("span");_.setAttribute("data-split-char",""),_.setAttribute("data-char-index",String($.chars.length)),_.style.display="inline-block",_.textContent=N,$.chars.push(_),W.appendChild(_)}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 _=document.createElement("span");_.setAttribute("data-split-char",""),_.setAttribute("data-char-index",String($.chars.length)),_.style.display="inline-block",_.textContent=N,$.chars.push(_),W.appendChild(_)}$.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 B of j.words){let H=B.getBoundingClientRect();if(H.top>z+2){if(G.length>0)q.push(G);G=[B],z=H.top}else G.push(B)}if(G.length>0)q.push(G);let W=new Map;for(let B of j.words)W.set(B,this._getWrapperChain(B,J));let N="",_=0,Y=0,X=0;for(let B of q){let H="",I=[];for(let K=0;K<B.length;K++){let O=B[K],M=O.textContent||"",k=W.get(O)||[],L=0;while(L<I.length&&L<k.length&&I[L]===k[L])L++;for(let P=I.length-1;P>=L;P--)H+=`</${I[P].tagName.toLowerCase()}>`;if(K>0)H+=" ";for(let P=L;P<k.length;P++)H+=this._openTag(k[P]);if(Q){let P="";for(let o0 of M)P+=`<span data-split-char data-char-index="${X}" style="display:inline-block">${this._escapeHtml(o0)}</span>`,X++;if($)H+=`<span data-split-word data-word-index="${Y}" style="display:inline-block;white-space:nowrap">${P}</span>`;else H+=P}else if($)H+=`<span data-split-word data-word-index="${Y}" style="display:inline-block">${this._escapeHtml(M)}</span>`;else H+=this._escapeHtml(M);Y++,I=k}for(let K=I.length-1;K>=0;K--)H+=`</${I[K].tagName.toLowerCase()}>`;N+=`<span data-split-line data-line-index="${_}" style="display:block">${H}</span>`,_++}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)=>T0.split(J,$,Q),revert:(J,$)=>T0.revert(J,$),isSplit:T0.isSplit};class eJ{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,_=Math.floor(W/Q);return{originalIndex:W,col:N,row:_}});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,_=Math.floor(j/Q);W=q==="x"?Math.abs(z.col-N)+Math.abs(z.row-_)*0.5:Math.abs(z.row-_)+Math.abs(z.col-N)*0.5}else if(j==="center"){let N=(Q-1)/2,_=(Z-1)/2;W=Math.abs(z.col-N)+Math.abs(z.row-_)}else if(j==="edges"){let N=Math.min(z.col,Q-1-z.col),_=Math.min(z.row,Z-1-z.row);W=Math.min(N,_)}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,$)=>eJ.resolve(J,$)};function w7(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,_=q.left+q.width/2,Y=q.top+q.height/2,X=_-W,B=Y-N,H=q.width/G,I=q.height/z;if(!Q)return{dx:X,dy:B,sx:H,sy:I,sourceWidth:j.width,sourceHeight:j.height,targetWidth:q.width,targetHeight:q.height};let K=J.offsetParent??document.documentElement,O=K.getBoundingClientRect(),M=K.scrollLeft??0,k=K.scrollTop??0;return{dx:X,dy:B,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-O.left+M,targetTop:q.top-O.top+k}}var u=0.01,X0=0.001;function P7(J,$,Q,Z){let{absolute:j=!1,scale:q=!0,resize:G=!1}=Q;if($ instanceof HTMLElement)v($,!1);let z=w7($,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)>u){let _=Z.acquire();_.init($,"x",0,W,"px"),J.addPropTween(_)}if(Math.abs(N)>u){let _=Z.acquire();_.init($,"y",0,N,"px"),J.addPropTween(_)}if(Math.abs(z.targetWidth-z.sourceWidth)>u){let _=Z.acquire();_.init($,"width",z.sourceWidth,z.targetWidth,"px"),J.addPropTween(_)}if(Math.abs(z.targetHeight-z.sourceHeight)>u){let _=Z.acquire();_.init($,"height",z.sourceHeight,z.targetHeight,"px"),J.addPropTween(_)}}else{let W=p($,"x"),N=p($,"y"),_=W+z.dx,Y=N+z.dy;if(Math.abs(_-W)>u||Math.abs(W)>u||Math.abs(_)>u){let X=Z.acquire();X.init($,"x",W,_,"px"),J.addPropTween(X)}if(Math.abs(Y-N)>u||Math.abs(N)>u||Math.abs(Y)>u){let X=Z.acquire();X.init($,"y",N,Y,"px"),J.addPropTween(X)}if(q){let X=p($,"scaleX"),B=p($,"scaleY"),H=X*z.sx,I=B*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-B)>X0||Math.abs(B-1)>X0||Math.abs(I-1)>X0){let K=Z.acquire();K.init($,"scaleY",B,I,""),J.addPropTween(K)}}}else{let W=$;if(window.getComputedStyle(W).position==="static")W.style.position="absolute";let{sourceLeft:_,sourceTop:Y,targetLeft:X,targetTop:B}=z;if(Math.abs(X-_)>u){let H=Z.acquire();H.init($,"left",_,X,"px"),J.addPropTween(H)}if(Math.abs(B-Y)>u){let H=Z.acquire();H.init($,"top",Y,B,"px"),J.addPropTween(H)}if(q){if(Math.abs(z.targetWidth-z.sourceWidth)>u){let H=Z.acquire();H.init($,"width",z.sourceWidth,z.targetWidth,"px"),J.addPropTween(H)}if(Math.abs(z.targetHeight-z.sourceHeight)>u){let H=Z.acquire();H.init($,"height",z.sourceHeight,z.targetHeight,"px"),J.addPropTween(H)}}}}function S7(J,$,Q,Z){J.setPendingFitSetup((G)=>P7(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:S7};var Z6=(J)=>J,y7=Z6,b={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 h0={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 j6=(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=j6();var q6=(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}}},c0=q6(),J6=(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-J6(1-J),out:J6,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}},$6={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 Y=G+z>>1;if(Z[Y].x<=q)G=Y;else z=Y}let W=Z[G],N=Z[z],_=(q-W.x)/(N.x-W.x);return W.y+(N.y-W.y)*_}},v7={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}},p0={in:g0(12),out:g0(12),inOut:g0(12)},Q6={linear:Z6,none:y7,power1:b.out,"power1.in":b.in,"power1.out":b.out,"power1.inout":b.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:b.out,"quad.in":b.in,"quad.out":b.out,"quad.inout":b.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:h0.out,"sine.in":h0.in,"sine.out":h0.out,"sine.inout":h0.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:c0.out,"elastic.in":c0.in,"elastic.out":c0.out,"elastic.inout":c0.inOut,bounce:K0.out,"bounce.in":K0.in,"bounce.out":K0.out,"bounce.inout":K0.inOut,slow:$6.inOut,"slow.in":b.out,"slow.out":b.out,"slow.inout":b.out,slowmo:$6.inOut,"slowmo.in":b.out,"slowmo.out":b.out,"slowmo.inout":b.out,rough:v7.inOut,"rough.in":b.out,"rough.out":b.out,"rough.inout":b.out,steps:p0.inOut,"steps.in":p0.in,"steps.out":p0.out,"steps.inout":p0.inOut},T7={back:(J)=>j6(J),elastic:(J,$)=>q6(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:$}}},h7=/^(\w+)(?:\.(\w+))?\(([^)]*)\)$/;function G6(J){let $=J.toLowerCase();if(Q6[$])return Q6[$];let Q=h7.exec($);if(Q){let[,Z,j,q]=Q,G=T7[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",Y=W[N==="inout"?"inOut":N];if(Y)return Y}}}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)`),b.out}class IJ{_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=G6(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),_=z>0?Math.floor(N/z):0,Y=N-_*z,X=Y>Q,B=Q>0?Math.min(1,Y/Q):1,H=this._yoyo&&_%2===1;if(X)B=H?0:1;else if(H)B=1-B;this._currentRepeat=this._repeat===-1?_:Math.min(_,this._repeat),this._isReversed=H,this._progress=B,this._time=Q*B,this.render(B)}}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 A0(()=>new IJ,100),z6={acquire:()=>k0.acquire(),release:(J)=>k0.release(J),getPoolSize:()=>k0.getPoolSize(),getTotalCreated:()=>k0.getTotalCreated(),clear:()=>k0.clear()};class C{static instance;animations=[];animationIdToIndex=new Map;nextAnimationId=1;totalCreated=0;_animationSnapshot=[];timelines=new Map;ticker;animationPool;propTweenPool;constructor(){this.ticker=V.getInstance(),this.animationPool=z6,this.propTweenPool=J0,this.ticker.add(this.update,0)}static getInstance(){if(!C.instance)C.instance=new C,E.setEngineRegisterCallback((J,$)=>{let Q=C.instance;if(!Q.hasTimeline(J))Q.registerTimeline(J,$)}),f.setCreateAnimationCallback((J,$,Q,Z,j,q,G,z)=>{return C.instance.createAnimation(J,$,Q,Z,j,q,G,z)});return C.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(),_=this.registerAnimation(N);if(N.init(_,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 Y=this.animationPool.acquire(),X=this.registerAnimation(Y);if(Y.init(X,J,Q,Z,j,W),this.setupPropertyTweens(Y,J,$,q,G),Q===0)Y.render(1);else if(q&&!W?._skipInitialRender)Y.render(0);return[Y]}let N=U.stagger.resolve(J,z),_=[];for(let Y=0;Y<J.length;Y++){let X=J[Y],B=N[Y],H=this.animationPool.acquire(),I=this.registerAnimation(H);if(H.init(I,[X],Q,Z+B,j,W),this.setupPropertyTweens(H,[X],$,q,G),Q===0)H.render(1);else if(q&&!W?._skipInitialRender)H.render(0);_.push(H)}return _}setupPropertyTweens(J,$,Q,Z,j){let q=N6(W6(Q)),G=j?N6(W6(j)):void 0,z=Object.keys(q),W=G?Object.keys(G):[],N=[...new Set([...z,...W])],_="perspective"in q,Y=G&&"perspective"in G,X=_&&Y;for(let B of $){if(!X&&(_||Y)&&B instanceof Element){let H=_?q.perspective:G.perspective,I=typeof H==="number"?H:parseFloat(String(H))||0;if(I>0)y(B,"perspective",I,"px"),B.style.transform=R(B)}for(let H of N){if(H==="perspective"&&!X)continue;let I=q[H],K=hJ(B,H,I,G?G[H]:void 0),O=this.propTweenPool.acquire(),M=Z&&!j;switch(K.type){case"color":{let k=M?K.endColor:K.startColor,L=M?K.startColor:K.endColor;O.initColor(B,H,k,L);break}case"filter":{let k=M?K.endFilters:K.startFilters,L=M?K.startFilters:K.endFilters;O.initFilter(B,H,k,L);break}case"scalar":{let k=M?K.endValue:K.startValue,L=M?K.startValue:K.endValue;O.init(B,H,k,L,K.unit);break}case"drawSVG":{let k=M?K.endDraw:K.startDraw,L=M?K.startDraw:K.endDraw;O.initDrawSVG(B,H,k,L,K.length);break}case"path":{let k=M?K.endProgress:K.startProgress,L=M?K.startProgress:K.endProgress;O.initPath(B,H,K.pathData,K.pathLength,k,L,K.rotate,K.alignOffset,K.pathOffset);break}}J.addPropTween(O)}}}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 E(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(),PJ()}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 W6(J){if(!("transform"in J))return J;let $=J.transform;if(typeof $!=="string")return J;let Q=/([a-zA-Z0-9]+)\(([^)]+)\)/g,Z,j={},q=!1;while((Z=Q.exec($))!==null){let z=Z[1],N=Z[2].match(/[-+]?\d*\.?\d+(?:e[-+]?\d+)?[a-z%]*/gi)||[];switch(z){case"perspective":{if(!("perspective"in J))j.perspective=N[0]||"0px",q=!0;break}case"translate":{if(N[0]&&!("x"in J))j.x=N[0],q=!0;if(N[1]&&!("y"in J))j.y=N[1],q=!0;break}case"translate3d":{if(N[0]&&!("x"in J))j.x=N[0],q=!0;if(N[1]&&!("y"in J))j.y=N[1],q=!0;if(N[2]&&!("z"in J))j.z=N[2],q=!0;break}case"translateX":{if(N[0]&&!("x"in J))j.x=N[0],q=!0;break}case"translateY":{if(N[0]&&!("y"in J))j.y=N[0],q=!0;break}case"translateZ":{if(N[0]&&!("z"in J))j.z=N[0],q=!0;break}case"rotate":{if(N[0]&&!("rotate"in J))j.rotate=N[0],q=!0;break}case"rotateX":{if(N[0]&&!("rotateX"in J))j.rotateX=N[0],q=!0;break}case"rotateY":{if(N[0]&&!("rotateY"in J))j.rotateY=N[0],q=!0;break}case"rotateZ":{if(N[0]&&!("rotateZ"in J))j.rotateZ=N[0],q=!0;break}case"scale":{if(N[0]&&!("scale"in J))j.scale=parseFloat(N[0]),q=!0;break}case"scaleX":{if(N[0]&&!("scaleX"in J))j.scaleX=parseFloat(N[0]),q=!0;break}case"scaleY":{if(N[0]&&!("scaleY"in J))j.scaleY=parseFloat(N[0]),q=!0;break}case"scaleZ":{if(N[0]&&!("scaleZ"in J))j.scaleZ=parseFloat(N[0]),q=!0;break}case"skew":{if(N[0]&&!("skewX"in J))j.skewX=N[0],q=!0;if(N[1]&&!("skewY"in J))j.skewY=N[1],q=!0;break}case"skewX":{if(N[0]&&!("skewX"in J))j.skewX=N[0],q=!0;break}case"skewY":{if(N[0]&&!("skewY"in J))j.skewY=N[0],q=!0;break}default:break}}if(!q)return J;let G={...j};for(let[z,W]of Object.entries(J)){if(z==="transform")continue;G[z]=W}return G}function N6(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 f7(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 u7(J,$,Q){if(Q===void 0)return(Z)=>Math.min($,Math.max(J,Z));return Math.min($,Math.max(J,Q))}function d7(J,$,Q){let Z=J+Math.random()*($-J);if(Q&&Q>0)return Math.round(Z/Q)*Q;return Z}function c7(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 p7(J,$,Q){return J+($-J)*Q}function m7(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 g7(J,$,Q){let Z=(j)=>(j-J)/($-J);if(Q===void 0)return Z;return Z(Q)}function l7(J,$,Q){let Z=$-J,j=(q)=>{return((q-J)%Z+Z)%Z+J};if(Q===void 0)return j;return j(Q)}var l0={toArray:f7,clamp:u7,random:d7,snap:c7,interpolate:p7,mapRange:m7,normalize:g7,wrap:l7};function l(J,$,Q){let j=C.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){C.getInstance();let $=D0(J),Q=[];for(let Z of $)if(Z instanceof Element)Q.push(Z);if(Q.length>0)C.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,$){C.getInstance();let Q=new E;Q._addEntry(J,{to:$,duration:0}),Q.kill(!1)};l.get=function(J){let $=C.getInstance();return $.hasTimeline(J)?$.getTimeline(J):void 0};l.has=function(J){return C.getInstance().hasTimeline(J)};l.getNames=function(){return C.getInstance().getTimelineNames()};l.kill=function(J){let $=C.getInstance();if($.hasTimeline(J))$.getTimeline(J).kill()};l.killAll=function(){C.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=l0;var _6=l;var Y6={};
|
|
32
32
|
|
|
33
|
-
//# debugId=
|
|
33
|
+
//# debugId=0537CFD541BACE4B64756E2164756E21
|
|
34
34
|
//# sourceMappingURL=index.js.map
|