@motion.page/sdk 1.2.3 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,35 +1,37 @@
1
- function d(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 I={color:null,filter:null,drawSVG:null,clipPath:null,stagger:null,textSplitter:null,textFlapper:null,triggerManager:null,styleReset:null,fit:null,responsive:null};class D{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(!D._instance)D._instance=new D;return D._instance}static registerTrigger(J,$){D._triggerRegistry.set(J,$)}static registerPageLoadTrigger(J){D._pageLoadTriggerFactory=J}_getPageLoadTrigger(){if(!this._pageLoadTrigger&&D._pageLoadTriggerFactory)this._pageLoadTrigger=new D._pageLoadTriggerFactory;return this._pageLoadTrigger}_createTrigger(J,...$){let Q=D._triggerRegistry.get(J);if(!Q){let Z=Array.from(D._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()},D._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()},D._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,onEnter:$.onEnter,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(D._instance){if(D._instance._pageLoadTrigger)D._instance._pageLoadTrigger._reset();D._instance.killAll(),D._instance=void 0}}}I.triggerManager={getInstance:D.getInstance};function O6(J){if(typeof document>"u"){J();return}if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",J,{once:!0});else J()}function U6(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 S0(J){return J instanceof Element||typeof J==="object"&&J!==null&&(("nodeType"in J)||("style"in J))}function YJ(J){if(U6(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(U6(J[0]))return J;return J}if(J&&typeof J==="object"&&"length"in J)return Array.from(J);return[]}class l{_timeline;_config;_enabled=!1;constructor(J,$){this._timeline=J,this._config=$}enable(){if(this._enabled)return;this._enabled=!0,O6(()=>{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 e(J){let $=J,Q=$.style.transform,Z=$.style.transition;$.style.transition="none",$.style.transform="none";let j=!1,q=$.style.position,z=$.style.top,G=$.style.left,N=$.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 H=$.getBoundingClientRect();if($.style.transform=Q,$.style.transition=Z,j)$.style.position=q,$.style.top=z,$.style.left=G,$.style.width=N;return H}var t0=new Map;function I6(){return typeof window<"u"?window:null}function T7(J,$){let Q=typeof window<"u"?window.requestAnimationFrame:void 0;if(typeof Q!=="function"){$();return}if(J.rafId!==null)return;J.rafId=Q(()=>{J.rafId=null,$()})}function J0(J,$=I6()){if(!$)return;let Q=t0.get($);if(!Q)Q={callbacks:new Set,lastEvent:null,rafId:null,listener:(Z)=>{let j=t0.get($);if(!j||j.callbacks.size===0)return;j.lastEvent=Z,T7(j,()=>{let q=j.lastEvent;if(!q)return;let z=Array.from(j.callbacks);for(let G of z)try{G(q)}catch(N){console.error("[Motion] Uncaught error in pointer callback:",N)}})}},t0.set($,Q),$.addEventListener("mousemove",Q.listener,{passive:!0});Q.callbacks.add(J)}function j0(J,$=I6()){if(!$)return;let Q=t0.get($);if(!Q)return;if(Q.callbacks.delete(J),Q.callbacks.size===0){if(Q.rafId!==null&&typeof window<"u"&&typeof window.cancelAnimationFrame==="function")window.cancelAnimationFrame(Q.rafId);$.removeEventListener("mousemove",Q.listener),t0.delete($)}}class F6 extends l{_targets=[];_secondTargets=[];_listeners=new Map;_isForward=!0;_frozenRects=new Map;_snapshotScrollX=0;_snapshotScrollY=0;_wasHovering=!1;_hoverLeaveTimeout=null;_boundPointerMoveHandler=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._boundPointerMoveHandler)j0(this._boundPointerMoveHandler),this._boundPointerMoveHandler=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(){if(typeof window>"u")return;this._snapshotScrollX=window.scrollX||0,this._snapshotScrollY=window.scrollY||0;for(let J of this._targets)this._frozenRects.set(J,e(J))}_isInsideFrozenRects(J,$){if(typeof window>"u")return!1;let Q=(window.scrollX||0)-this._snapshotScrollX,Z=(window.scrollY||0)-this._snapshotScrollY,j=J+Q,q=$+Z;for(let z of this._frozenRects.values())if(j>=z.left&&j<=z.right&&q>=z.top&&q<=z.bottom)return!0;return!1}_isOverLiveTarget(J,$){if(typeof document>"u"||typeof document.elementsFromPoint!=="function")return null;let Q=document.elementsFromPoint(J,$);for(let Z of Q)for(let j of this._targets)if(Z===j||typeof j.contains==="function"&&j.contains(Z))return!0;return!1}_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.onEnter||"play",$=this._config.onLeave||"reverse",Q=this._config.leaveDelay||0;this._snapshotRects(),this._boundPointerMoveHandler=(Z)=>{let j;if(this._wasHovering)j=this._isInsideFrozenRects(Z.clientX,Z.clientY);else j=this._isOverLiveTarget(Z.clientX,Z.clientY)??this._isInsideFrozenRects(Z.clientX,Z.clientY);if(j&&!this._wasHovering){if(this._wasHovering=!0,this._snapshotRects(),this._hoverLeaveTimeout!==null)clearTimeout(this._hoverLeaveTimeout),this._hoverLeaveTimeout=null;if(J==="restart"){let q=this._timeline.progress();if(q>=1||q===0)this._timeline.restart()}else this._timeline.play()}else if(!j&&this._wasHovering){if(this._wasHovering=!1,$==="none")return;let q=()=>{this._handleLeaveAction($),this._hoverLeaveTimeout=null};if(Q>0)this._hoverLeaveTimeout=window.setTimeout(q,Q*1000);else q()}},J0(this._boundPointerMoveHandler)}_handleLeaveAction(J){d(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=(z)=>{if($)z.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=(z)=>{if($)z.preventDefault();this._handleSecondClick(J)};Z.addEventListener("click",q),j.set("click",q),this._listeners.set(Z,j)})}_handleSecondClick(J){d(J,this._timeline)}}D.registerTrigger("event",F6);var XJ={perspective:0,x:1,y:2,z:3,rotate:4,rotateX:5,rotateY:6,rotateZ:7,scale:8,scaleX:9,scaleY:10,scaleZ:11,skewX:12,skewY:13},dJ=["px","px","px","px","deg","deg","deg","deg","","","","","deg","deg"],y0=new WeakMap,KJ=new WeakMap,x=[];function q0(J){let $=J.trim().match(/([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z%]*)/i);if(!$)return{value:0,unit:""};return{value:parseFloat($[1]),unit:$[2]||""}}function P0(J,$){switch($){case"rad":return J*180/Math.PI;case"turn":return J*360;case"grad":return J*0.9;default:return J}}function O0(J){let $=q0(J);return P0($.value,$.unit||"deg")}function M(J,$,Q,Z){let j=XJ[$];if(j===void 0)return;J.values[j]=Q;let q=Z&&Z.length>0?Z:dJ[j]||"";J.units[j]=q,J.used|=1<<j}function h7(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 z=q[0]?q0(q[0]):{value:0,unit:""},G=q[1]?q0(q[1]):{value:0,unit:""};M($,"x",z.value,z.unit),M($,"y",G.value,G.unit);break}case"translate3d":{let z=q[0]?q0(q[0]):{value:0,unit:""},G=q[1]?q0(q[1]):{value:0,unit:""},N=q[2]?q0(q[2]):{value:0,unit:""};M($,"x",z.value,z.unit),M($,"y",G.value,G.unit),M($,"z",N.value,N.unit);break}case"translateX":{let z=q[0]?q0(q[0]):{value:0,unit:""};M($,"x",z.value,z.unit);break}case"translateY":{let z=q[0]?q0(q[0]):{value:0,unit:""};M($,"y",z.value,z.unit);break}case"translateZ":{let z=q[0]?q0(q[0]):{value:0,unit:""};M($,"z",z.value,z.unit);break}case"scale":{let z=q[0]?parseFloat(q[0]):1,G=q[1]?parseFloat(q[1]):z;M($,"scaleX",z),M($,"scaleY",G);break}case"scale3d":{let z=q[0]?parseFloat(q[0]):1,G=q[1]?parseFloat(q[1]):1,N=q[2]?parseFloat(q[2]):1;M($,"scaleX",z),M($,"scaleY",G),M($,"scaleZ",N);break}case"scaleX":{let z=q[0]?parseFloat(q[0]):1;M($,"scaleX",z);break}case"scaleY":{let z=q[0]?parseFloat(q[0]):1;M($,"scaleY",z);break}case"scaleZ":{let z=q[0]?parseFloat(q[0]):1;M($,"scaleZ",z);break}case"rotate":M($,"rotate",q[0]?O0(q[0]):0,"deg");break;case"rotateX":M($,"rotateX",q[0]?O0(q[0]):0,"deg");break;case"rotateY":M($,"rotateY",q[0]?O0(q[0]):0,"deg");break;case"rotateZ":M($,"rotateZ",q[0]?O0(q[0]):0,"deg");break;case"skew":{let z=q[0]?O0(q[0]):0,G=q[1]?O0(q[1]):0;M($,"skewX",z,"deg"),M($,"skewY",G,"deg");break}case"skewX":M($,"skewX",q[0]?O0(q[0]):0,"deg");break;case"skewY":M($,"skewY",q[0]?O0(q[0]):0,"deg");break;case"perspective":{let z=q[0]?q0(q[0]):{value:0,unit:""};M($,"perspective",z.value,z.unit);break}default:break}}}function fJ(J,$,Q,Z,j,q,z,G,N,H,K,Y,W,X){if(W){let n=Math.hypot(J,$),_0=J*j-$*Z,r0=n!==0?_0/n:0,r=n!==0?Math.atan2($,J):0,Z0=n!==0?Math.atan2(J*Z+$*j,n*n):0;if(M(X,"x",H,"px"),M(X,"y",K,"px"),M(X,"scaleX",n||1),M(X,"scaleY",r0||1),M(X,"rotate",P0(r,"rad"),"deg"),Math.abs(Z0)>0.000001)M(X,"skewX",P0(Z0,"rad"),"deg");return}let _=Math.hypot(J,$,Q)||1,U=Math.hypot(Z,j,q)||1,B=Math.hypot(z,G,N)||1,O=J/_,F=$/_,A=Q/_,L=Z/U,k=j/U,K0=q/U,R0=z/B,a0=G/B,k0=N/B,i=Math.sqrt(O*O+L*L),C0=i<0.000001,b0=0,X0=0,E0=0;if(!C0)b0=Math.atan2(a0,k0),X0=Math.atan2(-R0,i),E0=Math.atan2(L,O);else b0=Math.atan2(-K0,k),X0=Math.atan2(-R0,i),E0=0;M(X,"x",H,"px"),M(X,"y",K,"px"),M(X,"z",Y,"px"),M(X,"scaleX",_),M(X,"scaleY",U),M(X,"scaleZ",B),M(X,"rotateX",P0(b0,"rad"),"deg"),M(X,"rotateY",P0(X0,"rad"),"deg"),M(X,"rotateZ",P0(E0,"rad"),"deg")}function f7(J,$){if(!J||J==="none")return;if(typeof DOMMatrixReadOnly<"u"){let Z=new DOMMatrixReadOnly(J);fJ(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);fJ(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);fJ(Z[0],Z[1],0,Z[2],Z[3],0,0,0,1,Z[4],Z[5],0,!0,$)}}function u7(J,$){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let Z=J.style.transform;if(Z&&Z!=="none"){h7(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")f7(q,$),$.cachedString=q}}catch{}}function mJ(J){let $=y0.get(J);if(!$){let Q=new Float32Array(14);Q[8]=1,Q[9]=1,Q[10]=1,Q[11]=1,$={values:Q,units:[...dJ],dirty:0,used:0,cachedString:"",pinDirty:!1},u7(J,$),y0.set(J,$)}return $}function E(J,$,Q,Z){let j=mJ(J),q=XJ[$];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 cJ(J,$){let Q=mJ(J),Z=XJ[$];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 pJ(J,$){let Q=mJ(J),Z=XJ[$];if(Z===void 0)return"";return Q.units[Z]||dJ[Z]||""}function uJ(J){return J===0?"0":`${Math.round(J)}px`}function A6(J,$,Q){return`translate3d(${uJ(J)}, ${uJ($)}, ${uJ(Q)})`}function _J(J,$,Q,Z){KJ.set(J,{x:$,y:Q,z:Z});let j=y0.get(J);if(j)j.pinDirty=!0}function v0(J){let $=KJ.has(J);if(KJ.delete(J),$){let Q=y0.get(J);if(Q)Q.pinDirty=!0}}function C(J){let $=y0.get(J),Q=KJ.get(J);if(!$){if(Q&&(Q.x!==0||Q.y!==0||Q.z!==0))return A6(Q.x,Q.y,Q.z);return""}if($.dirty===0&&!$.pinDirty&&$.cachedString)return $.cachedString;let{values:Z,units:j}=$;x.length=0;let q=$.used,z=Z[0];if(z!==0){let L=j[0];x.push(`perspective(${z}${L})`)}let G=Z[1],N=Z[2],H=Z[3],K=j[1],Y=j[2],W=j[3],X=q&2,_=q&4,U=q&8;if(G!==0||N!==0||H!==0||X||_||U){let L=K===Y&&(H===0&&!U||Y===W);if(H!==0||U)if(L)x.push(`translate3d(${G}${K}, ${N}${Y}, ${H}${W})`);else{if(G!==0||X)x.push(`translateX(${G}${K})`);if(N!==0||_)x.push(`translateY(${N}${Y})`);x.push(`translateZ(${H}${W})`)}else if(L&&(G!==0||X)&&(N!==0||_))x.push(`translate(${G}${K}, ${N}${Y})`);else{if(G!==0||X)x.push(`translateX(${G}${K})`);if(N!==0||_)x.push(`translateY(${N}${Y})`)}}if(Z[4]!==0||q&16)x.push(`rotate(${Z[4]}deg)`);if(Z[5]!==0||q&32)x.push(`rotateX(${Z[5]}deg)`);if(Z[6]!==0||q&64)x.push(`rotateY(${Z[6]}deg)`);if(Z[7]!==0||q&128)x.push(`rotateZ(${Z[7]}deg)`);let B=q&256,O=q&512,F=q&1024;if(Z[8]!==1||B)x.push(`scale(${Z[8]})`);else if(Z[9]!==1||Z[10]!==1||O||F)x.push(`scaleX(${Z[9]})`),x.push(`scaleY(${Z[10]})`);if(Z[11]!==1||q&2048)x.push(`scaleZ(${Z[11]})`);if(Z[12]!==0||q&4096)x.push(`skewX(${Z[12]}deg)`);if(Z[13]!==0||q&8192)x.push(`skewY(${Z[13]}deg)`);let A=x.join(" ");if(Q&&(Q.x!==0||Q.y!==0||Q.z!==0)){let L=A6(Q.x,Q.y,Q.z);$.cachedString=A?`${L} ${A}`:L}else $.cachedString=A;return $.dirty=0,$.pinDirty=!1,$.cachedString}function y(J,$=!1){if(y0.delete(J),$&&J instanceof HTMLElement)J.style.transform=""}var gJ=new Set,BJ=new Map,WJ=!1;function G0(J){gJ.add(J),WJ=!0}function V0(J,$,Q){let Z=BJ.get(J);if(!Z)Z=new Map,BJ.set(J,Z);Z.set($,Q),WJ=!0}function oJ(){if(!WJ)return;for(let J of gJ){let $=J;if($.style){let Q=C(J);$.style.transform=Q}}gJ.clear();for(let[J,$]of BJ){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{}}BJ.clear(),WJ=!1}var w0=!1;function I0(){return w0}function e0(J){if(w0){J();return}w0=!0;try{J(),oJ()}finally{w0=!1}}class T{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(!T.instance)T.instance=new T;return T.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($),w0=!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{oJ()}catch(Z){console.error("[Motion] Uncaught error in render batch flush:",Z)}if(w0=!1,this._isRunning&&typeof requestAnimationFrame<"u")this.rafId=requestAnimationFrame(this.tick);else this.rafId=null};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 w0}getListenerCount(){return this.listeners.length}removeAll(){this.listeners=[],this.stop()}}var L6=new Set(["perspective","x","y","z","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skewX","skewY"]),M6=new Set(["perspective","x","y","z","width","height","top","left","right","bottom","margin","marginTop","marginRight","marginBottom","marginLeft","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","borderRadius","fontSize","lineHeight"]),D6=new Set(["rotate","rotateX","rotateY","rotateZ","skewX","skewY"]),R6=new Set(["opacity","scale","scaleX","scaleY","scaleZ","z-index","zIndex"]),k6=new Set(["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor","textDecorationColor","caretColor","fill","stroke"]),b6=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"]),lJ=new Set(["width","height"]);function w(J){return L6.has(J)}function $0(J){return k6.has(J)}function c(J){return J==="filter"}function B0(J){return J==="drawSVG"}function T0(J){return J==="path"}function h0(J){return J==="clip-path"||J==="clipPath"}function p(J){return J.startsWith("--")}function f0(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=I.color;if(Q)return Q.parseColor($)!==null;return b6.has($)}function S(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(R6.has(J))return"";if(D6.has(J))return"deg";if(M6.has(J))return"px";return""}function E6(J){if(J==="opacity")return 1;if(J.startsWith("scale"))return 1;return 0}function Q0(J,$){if(!(J instanceof Element)){let Q=J;if($ in Q)return Q[$];return d7($)}if(w($))return cJ(J,$);try{if(typeof window<"u"&&window.getComputedStyle){let Z=window.getComputedStyle(J).getPropertyValue(h($));if(Z)return S(Z).value}}catch(Q){}return E6($)}function V6(J,$,Q,Z){if(!Z||Z==="px")return Q;if(typeof window>"u"||!window.getComputedStyle)return Q;let j=J,q=h($);try{let z=j.style.getPropertyValue(q);j.style.setProperty(q,`100${Z}`);let G=window.getComputedStyle(J),N=parseFloat(G.getPropertyValue(q));if(z)j.style.setProperty(q,z);else j.style.removeProperty(q);if(N&&isFinite(N)&&N!==0)return Q/N*100}catch{}return Q}function u0(J,$,Q){let Z=Q0(J,$);if(J instanceof Element&&Q&&Q!=="px")return V6(J,$,Z,Q);return Z}function sJ(J,$){let Q=J,Z=h($);if(w($)){let j=Q.style.transform;y(J),Q.style.transform="";let q=cJ(J,$);return Q.style.transform=j,y(J),{value:q,unit:g($)}}try{if(typeof window<"u"&&window.getComputedStyle){let j=Q.style.getPropertyValue(Z);Q.style.removeProperty(Z);let z=window.getComputedStyle(J).getPropertyValue(Z);if(j)Q.style.setProperty(Z,j);if(z){let G=S(z);return{value:G.value,unit:G.unit}}}}catch(j){}return{value:E6($),unit:g($)}}function d7(J){if(J.startsWith("scale"))return 1;return 0}function h(J){return J.replace(/[A-Z]/g,($)=>`-${$.toLowerCase()}`)}function iJ(J){if(typeof J==="string")return/^[+\-*/]=/.test(J);return!1}function nJ(J){let $=J.match(/^([+\-*/])=/);return $?$[0]:null}function aJ(J,$,Q){switch(Q){case"+=":return J+$;case"-=":return J-$;case"*=":return J*$;case"/=":return $!==0?J/$:J;default:return $}}var N0=null,d0=null,m7=100,z0=new Map;function c7(J){let $=z0.get(J);if($!==void 0)z0.delete(J),z0.set(J,$);return $}function p7(J,$){if(z0.has(J))z0.delete(J);while(z0.size>=m7){let Q=z0.keys().next().value;if(Q!==void 0)z0.delete(Q);else break}z0.set(J,$)}function w6(J){return/^\s*[Mm]/.test(J)}function x6(){if(d0)return d0;if(typeof document>"u")throw Error("PathParser requires a browser environment");return N0=document.createElementNS("http://www.w3.org/2000/svg","svg"),N0.style.cssText="position:absolute;width:0;height:0;overflow:hidden;visibility:hidden;",N0.setAttribute("aria-hidden","true"),d0=document.createElementNS("http://www.w3.org/2000/svg","path"),N0.appendChild(d0),document.body.appendChild(N0),d0}function C6(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 S6(J){let $=c7(J);if($!==void 0)return $;try{let Q=x6();Q.setAttribute("d",J);let Z=Q.getTotalLength();return p7(J,Z),Z}catch{return 0}}function rJ(J,$,Q=!1){try{let Z=x6();Z.setAttribute("d",J);let j=Z.getTotalLength(),q=Math.max(0,Math.min(1,$)),z=j*q,G=Z.getPointAtLength(z),N=0;if(Q)N=g7(Z,z,j);return{x:G.x,y:G.y,angle:N}}catch{return{x:0,y:0,angle:0}}}function g7(J,$,Q){let Z=Math.min(0.1,Q*0.001),j=Math.max(0,$-Z),q=Math.min(Q,$+Z),z=J.getPointAtLength(j),G=J.getPointAtLength(q),N=G.x-z.x,H=G.y-z.y;return Math.atan2(H,N)*(180/Math.PI)}function P6(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 y6(J){let $=null;if(J instanceof Element)$=J;else if(typeof J==="string"&&!w6(J)&&typeof document<"u")$=document.querySelector(J);if(!$)return{x:1,y:1};let Q=$;if(typeof Q.getScreenCTM==="function"){let Z=Q.getScreenCTM();if(Z){let j=Math.hypot(Z.a,Z.b),q=Math.hypot(Z.c,Z.d);if(j>0&&q>0&&isFinite(j)&&isFinite(q))return{x:j,y:q}}}if(typeof Q.getBBox==="function"&&typeof Q.getBoundingClientRect==="function")try{let Z=Q.getBBox(),j=Q.getBoundingClientRect();if(Z.width>0&&Z.height>0)return{x:j.width/Z.width,y:j.height/Z.height}}catch{}return{x:1,y:1}}function v6(J,$,Q,Z={x:1,y:1}){if(!J)return{x:0,y:0};let j=null;if(J instanceof Element)j=J;else if(typeof J==="string"&&typeof document<"u")j=document.querySelector(J);if(!j)return{x:0,y:0};let q=rJ($,0,!1),z={x:q.x*Z.x,y:q.y*Z.y};if(Q&&Q instanceof HTMLElement){let G=Q.style.transform,N=G&&G!=="none"&&G!=="";if(N)Q.style.transform="none";let H=Q.getBoundingClientRect(),K=j.getScreenCTM?.();if(K&&isFinite(K.e)&&isFinite(K.f)){if(N)Q.style.transform=G;return{x:K.e-H.left,y:K.f-H.top}}let Y=j.getBoundingClientRect();if(N)Q.style.transform=G;let W=Y.left+Y.width/2-(H.left+H.width/2),X=Y.top+Y.height/2-(H.top+H.height/2);return{x:W-z.x,y:X-z.y}}return{x:-z.x,y:-z.y}}function T6(){if(N0&&N0.parentNode)N0.parentNode.removeChild(N0);N0=null,d0=null,z0.clear()}function h6(J){return typeof J==="string"&&J.trim().toLowerCase()==="auto"}function o7(J,$){if(!lJ.has($))return 0;let Q=J,Z=h($);try{let j=Q.style.getPropertyValue(Z);Q.style.setProperty(Z,"auto");let q=$==="width"?Q.offsetWidth:Q.offsetHeight;if(j)Q.style.setProperty(Z,j);else Q.style.removeProperty(Z);return q}catch{return 0}}function f6(J){return typeof J==="string"&&/(?:^|[^a-z])(var|calc|clamp|min|max|env)\s*\(/i.test(J)}function l7(J){return!$0(J)&&!c(J)&&!B0(J)&&!h0(J)&&!T0(J)&&!w(J)}var s7="letter-spacing";function u6(J,$,Q){if(typeof window>"u"||!window.getComputedStyle)return null;let Z=J,j=p($)?s7:h($);try{let q=Z.style.getPropertyValue(j),z=Z.style.getPropertyPriority(j);Z.style.setProperty(j,Q);let G=window.getComputedStyle(J).getPropertyValue(j);if(q)Z.style.setProperty(j,q,z);else Z.style.removeProperty(j);let N=parseFloat(G);return isFinite(N)?N:null}catch{return null}}function i7(J,$,Q,Z){let j=I.color;if(!j)return null;let q=String(Q),z=q===""?j.getCurrentColor(J,$):j.parseColor(q,J),G=Z!==void 0?j.parseColor(String(Z),J):j.getCurrentColor(J,$);return{type:"color",property:$,isTransform:!1,startColor:G||new Float32Array([0,0,0,1]),endColor:z||new Float32Array([0,0,0,1])}}function n7(J,$,Q,Z){let j=I.filter;if(!j)return null;let q=String(Q),z=q===""?j.getCurrentFilter(J):j.parseFilter(q),G=Z!==void 0?j.parseFilter(String(Z)):j.getCurrentFilter(J);G=G||[],z=z||[];let N=j.mergeFilterArrays(G,z);return{type:"filter",property:$,isTransform:!1,startFilters:N.start,endFilters:N.end}}function a7(J,$,Q,Z){if(f0(Q)||Z!==void 0&&f0(Z)){let N=I.color;if(N){let H=String(Q),K=N.parseColor(H,J),Y=Z!==void 0?N.parseColor(String(Z),J):r7(J,$);return{type:"color",property:$,isTransform:!1,startColor:Y||new Float32Array([0,0,0,1]),endColor:K||new Float32Array([0,0,0,1])}}}let q,z,G;if(Z!==void 0&&Q!==void 0){let N=S(Z),H=S(Q);q=N.value,z=H.value,G=H.unit||N.unit}else if(Z!==void 0){let N=S(Z);q=N.value,z=d6(J,$),G=N.unit}else{let N=S(Q);q=d6(J,$),z=N.value,G=N.unit}return{type:"scalar",property:$,isTransform:!1,startValue:q,endValue:z,unit:G}}function r7(J,$){let Q=I.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 d6(J,$){try{if(typeof window<"u"&&window.getComputedStyle){let Z=window.getComputedStyle(J).getPropertyValue($).trim();if(Z)return S(Z).value}}catch{}return 0}function t7(J,$,Q,Z){let j=I.drawSVG;if(!j)return null;let q=j.getPathLength(J),z=j.parseDrawSVG(Q,J)||{start:0,end:1},G=Z!==void 0?j.parseDrawSVG(Z,J)||{start:0,end:1}:j.getCurrentDrawSVG(J);return{type:"drawSVG",property:$,isTransform:!1,startDraw:G,endDraw:z,length:q}}function F0(J,$="%"){return{value:0,unit:J?.unit||$}}function m6(J){switch(J.shape){case"inset":return{shape:"inset",components:[F0(J.components[0]),F0(J.components[1]),F0(J.components[2]),F0(J.components[3]),...J.components.slice(4)],extras:J.extras};case"circle":return{shape:"circle",components:[{value:150,unit:"%"},J.components[1]??{value:50,unit:"%"},J.components[2]??{value:50,unit:"%"}],extras:J.extras};case"ellipse":return{shape:"ellipse",components:[{value:150,unit:"%"},{value:150,unit:"%"},J.components[2]??{value:50,unit:"%"},J.components[3]??{value:50,unit:"%"}],extras:J.extras};case"rect":return{shape:"rect",components:[F0(J.components[0]),{value:100,unit:J.components[1]?.unit||"%"},{value:100,unit:J.components[2]?.unit||"%"},F0(J.components[3]),...J.components.slice(4)],extras:J.extras};case"xywh":return{shape:"xywh",components:[F0(J.components[0]),F0(J.components[1]),{value:100,unit:J.components[2]?.unit||"%"},{value:100,unit:J.components[3]?.unit||"%"},...J.components.slice(4)],extras:J.extras};default:return J}}function e7(J,$,Q,Z){let j=I.clipPath;if(!j)return null;let q;if(Q===void 0||Q==="")q=j.getCurrentClipPath(J);else q=j.parseClipPath(String(Q));let z;if(Z!==void 0)z=j.parseClipPath(String(Z));else z=j.getCurrentClipPath(J);let G=z,N=q;if(!G&&!N)return null;if(!G)G=m6(N);if(!N)N=m6(G);return{type:"clipPath",property:$,isTransform:!1,startClipPath:G,endClipPath:N}}function J9(J,$,Q,Z){let j=Q,q=Z,z=j?.target?j:q;if(!z?.target)return null;let G=C6(z.target);if(!G)return null;let N=S6(G);if(N===0)return null;let H,K;if(j?.target&&q?.target)H=q.start??0,K=j.end??1;else if(j?.target)H=j.start??0,K=j.end??1;else H=q.start??0,K=q.end??1;let Y=j?.rotate??q?.rotate??!1,W=j?.alignAt??q?.alignAt??[50,50],X=P6(J,W),_=j?.align??q?.align,U=_?y6(z.target):{x:1,y:1},B=v6(_,G,J,U);return{type:"path",property:$,isTransform:!1,pathData:G,pathLength:N,startProgress:H,endProgress:K,rotate:Y,alignOffset:X,pathOffset:B,pathScale:U}}function JJ(J,$,Q,Z){let j=J instanceof Element;if(j&&l7($)){let _=f6(Q)&&!f0(Q),U=Z!==void 0&&f6(Z)&&!f0(Z);if(_||U){let B=_?u6(J,$,Q):null,O=U?u6(J,$,Z):null;if(B!==null||O!==null){let F=B!==null?`${B}px`:Q,A=O!==null?`${O}px`:Z;return JJ(J,$,F,A)}}}if(j&&p($))return a7(J,$,Q,Z);if(j&&$0($)){let _=i7(J,$,Q,Z);if(_)return _}if(j&&c($)){let _=n7(J,$,Q,Z);if(_)return _}if(j&&B0($)){let _=t7(J,$,Q,Z);if(_)return _}if(j&&h0($)){let _=e7(J,$,Q,Z);if(_)return _}if(j&&T0($)){let _=J9(J,$,Q,Z);if(_)return _}let q=h6(Q),z=Z!==void 0&&h6(Z);if(j&&(q||z)&&lJ.has($)){let _=o7(J,$);return JJ(J,$,q?_:Q,z?_:Z)}let G=w($),N=Z===void 0&&iJ(Q),H,K,Y,W,X;if(Z!==void 0){let _=S(Z);if(Q!==void 0){let U=S(Q);H=_.value,K=U.value,Y=U.unit||_.unit||g($);let B=_.unit||Y,O=U.unit||Y;if(!G&&B!==O)W=B,X=O}else H=_.value,Y=_.unit||g($),K=u0(J,$,Y)}else if(N){let _=nJ(Q),U=Q0(J,$),B=S(Q);H=U,K=aJ(U,B.value,_),Y=B.unit||g($)}else{let _=S(Q);Y=_.unit||g($),H=u0(J,$,Y),K=_.value}return{type:"scalar",property:$,isTransform:G,startValue:H,endValue:K,unit:Y,startUnit:W,endUnit:X}}function c6(){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 tJ=c6(),UJ=new WeakMap,eJ=c6();function p6(J){if(w(J))return["transform"];if(c(J))return["filter"];if(B0(J))return["strokeDasharray","strokeDashoffset"];return[J]}function $9(J,$){if(w($)&&!UJ.has(J)){if(J instanceof HTMLElement||J instanceof SVGElement){let Z=J.style.transform;UJ.set(J,Z||null)}}let Q=p6($);for(let Z of Q)tJ.register(J,Z)}function Q9(J,$){for(let Q of $)$9(J,Q)}function Z9(J){tJ.clearRegistry(J),UJ.delete(J)}function j9(J,$){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let Q=new Set;for(let Z of $)for(let j of p6(Z))Q.add(j);for(let Z of Q)if(p(Z))J.style.removeProperty(Z);else J.style[Z]=""}function q9(J){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let $=tJ.get(J);if(!$||$.size===0)return;for(let Q of $){if(Q==="transform"){let Z=UJ.get(J);if(Z!==void 0){if(Z)J.style.transform=Z;else J.style.removeProperty("transform");continue}}if(p(Q))J.style.removeProperty(Q);else J.style[Q]=""}}function G9(J){q9(J),Z9(J)}function $J(J,$){eJ.registerMany(J,$)}function J6(J){eJ.clearRegistry(J)}function z9(J){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let $=eJ.get(J);if(!$||$.size===0)return;for(let Q of $)J.style[Q]=""}function N9(J){z9(J),J6(J)}I.styleReset={registerAnimatedProps:Q9,clearAnimationStylesForProps:j9,clearAnimationStylesAndUnregister:G9,clearPinStylesAndUnregister:N9};class f{static _registry=new Map;static _users=new Map;static getOrCreate(J,$){let Q=f._registry.get($);if(!Q)Q=new f(J),f._registry.set($,Q);let Z=f._users.get($);if(!Z)Z=new Set,f._users.set($,Z);return Z.add(J),Q}static release(J,$){let Q=f._users.get($);if(!Q)return;if(Q.delete(J),Q.size===0){let Z=f._registry.get($);f._registry.delete($),f._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 z=this._pinDistance;this._pinDistance=Q-$,this._useFixedPin=j,this._pinSpacing=q;let G=this._isBodyPin?this._originalStyles!==null:this._spacer!==null;if(G&&this._currentState==="pinned"&&j)this._applyFixedState("before");if(G&&this._spacer)this._spacer.style.width="";let N=G&&this._isBodyPin?document.documentElement.style.height:null;if(N!==null)document.documentElement.style.height=this._originalHtmlHeight;let H=J.getBoundingClientRect();if(N!==null)document.documentElement.style.height=N;let K=G&&this._spacer?window.getComputedStyle(this._spacer):window.getComputedStyle(J);if(this._elementHeight=H.height,!G)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=H.left,this._width=H.width,!G)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(),W=window.getComputedStyle(J),X=W.display,_=W.flexDirection,U=G&&this._spacer?.parentElement?this._spacer.parentElement:J.parentElement,B=U?/^(inline-)?flex$/.test(getComputedStyle(U).display):!1,O=/^(inline-)?flex$/.test(X),F=`
2
- display: ${X};
3
- ${O?`flex-direction: ${_};`:""}
1
+ function m(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 I={color:null,filter:null,drawSVG:null,clipPath:null,stagger:null,textSplitter:null,textFlapper:null,triggerManager:null,styleReset:null,fit:null,responsive:null};class D{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(!D._instance)D._instance=new D;return D._instance}static registerTrigger(J,$){D._triggerRegistry.set(J,$)}static registerPageLoadTrigger(J){D._pageLoadTriggerFactory=J}_getPageLoadTrigger(){if(!this._pageLoadTrigger&&D._pageLoadTriggerFactory)this._pageLoadTrigger=new D._pageLoadTriggerFactory;return this._pageLoadTrigger}_createTrigger(J,...$){let Q=D._triggerRegistry.get(J);if(!Q){let Z=Array.from(D._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()},D._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()},D._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,onEnter:$.onEnter,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(D._instance){if(D._instance._pageLoadTrigger)D._instance._pageLoadTrigger._reset();D._instance.killAll(),D._instance=void 0}}}I.triggerManager={getInstance:D.getInstance};function k6(J){if(typeof document>"u"){J();return}if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",J,{once:!0});else J()}function D6(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 P0(J){return J instanceof Element||typeof J==="object"&&J!==null&&(("nodeType"in J)||("style"in J))}function YJ(J){if(D6(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(D6(J[0]))return J;return J}if(J&&typeof J==="object"&&"length"in J)return Array.from(J);return[]}class t{_timeline;_config;_enabled=!1;constructor(J,$){this._timeline=J,this._config=$}enable(){if(this._enabled)return;this._enabled=!0,k6(()=>{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 g(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,H=$.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=H;return N}var t0=new Map;function R6(){return typeof window<"u"?window:null}function l7(J,$){let Q=typeof window<"u"?window.requestAnimationFrame:void 0;if(typeof Q!=="function"){$();return}if(J.rafId!==null)return;J.rafId=Q(()=>{J.rafId=null,$()})}function G0(J,$=R6()){if(!$)return;let Q=t0.get($);if(!Q)Q={callbacks:new Set,lastEvent:null,rafId:null,listener:(Z)=>{let j=t0.get($);if(!j||j.callbacks.size===0)return;j.lastEvent=Z,l7(j,()=>{let q=j.lastEvent;if(!q)return;let G=Array.from(j.callbacks);for(let z of G)try{z(q)}catch(H){console.error("[Motion] Uncaught error in pointer callback:",H)}})}},t0.set($,Q),$.addEventListener("mousemove",Q.listener,{passive:!0});Q.callbacks.add(J)}function K0(J,$=R6()){if(!$)return;let Q=t0.get($);if(!Q)return;if(Q.callbacks.delete(J),Q.callbacks.size===0){if(Q.rafId!==null&&typeof window<"u"&&typeof window.cancelAnimationFrame==="function")window.cancelAnimationFrame(Q.rafId);$.removeEventListener("mousemove",Q.listener),t0.delete($)}}class b6 extends t{_targets=[];_secondTargets=[];_listeners=new Map;_isForward=!0;_frozenRects=new Map;_snapshotScrollX=0;_snapshotScrollY=0;_wasHovering=!1;_hoverLeaveTimeout=null;_boundPointerMoveHandler=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._boundPointerMoveHandler)K0(this._boundPointerMoveHandler),this._boundPointerMoveHandler=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(){if(typeof window>"u")return;this._snapshotScrollX=window.scrollX||0,this._snapshotScrollY=window.scrollY||0;for(let J of this._targets)this._frozenRects.set(J,g(J))}_isInsideFrozenRects(J,$){if(typeof window>"u")return!1;let Q=(window.scrollX||0)-this._snapshotScrollX,Z=(window.scrollY||0)-this._snapshotScrollY,j=J+Q,q=$+Z;for(let G of this._frozenRects.values())if(j>=G.left&&j<=G.right&&q>=G.top&&q<=G.bottom)return!0;return!1}_isOverLiveTarget(J,$){if(typeof document>"u"||typeof document.elementsFromPoint!=="function")return null;let Q=document.elementsFromPoint(J,$);for(let Z of Q)for(let j of this._targets)if(Z===j||typeof j.contains==="function"&&j.contains(Z))return!0;return!1}_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.onEnter||"play",$=this._config.onLeave||"reverse",Q=this._config.leaveDelay||0;this._snapshotRects(),this._boundPointerMoveHandler=(Z)=>{let j;if(this._wasHovering)j=this._isInsideFrozenRects(Z.clientX,Z.clientY);else j=this._isOverLiveTarget(Z.clientX,Z.clientY)??this._isInsideFrozenRects(Z.clientX,Z.clientY);if(j&&!this._wasHovering){if(this._wasHovering=!0,this._snapshotRects(),this._hoverLeaveTimeout!==null)clearTimeout(this._hoverLeaveTimeout),this._hoverLeaveTimeout=null;if(J==="restart"){let q=this._timeline.progress();if(q>=1||q===0)this._timeline.restart()}else this._timeline.play()}else if(!j&&this._wasHovering){if(this._wasHovering=!1,$==="none")return;let q=()=>{this._handleLeaveAction($),this._hoverLeaveTimeout=null};if(Q>0)this._hoverLeaveTimeout=window.setTimeout(q,Q*1000);else q()}},G0(this._boundPointerMoveHandler)}_handleLeaveAction(J){m(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){m(J,this._timeline)}}D.registerTrigger("event",b6);var XJ={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},lJ=["px","px","px","px","deg","deg","deg","deg","","","","","deg","deg"],v0=new WeakMap,KJ=new WeakMap,w=[];function X0(J){let $=J.trim().match(/([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z%]*)/i);if(!$)return{value:0,unit:""};return{value:parseFloat($[1]),unit:$[2]||""}}function y0(J,$){switch($){case"rad":return J*180/Math.PI;case"turn":return J*360;case"grad":return J*0.9;default:return J}}function D0(J){let $=X0(J);return y0($.value,$.unit||"deg")}function M(J,$,Q,Z){let j=XJ[$];if(j===void 0)return;J.values[j]=Q;let q=Z&&Z.length>0?Z:lJ[j]||"";J.units[j]=q,J.used|=1<<j}function s7(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]?X0(q[0]):{value:0,unit:""},z=q[1]?X0(q[1]):{value:0,unit:""};M($,"x",G.value,G.unit),M($,"y",z.value,z.unit);break}case"translate3d":{let G=q[0]?X0(q[0]):{value:0,unit:""},z=q[1]?X0(q[1]):{value:0,unit:""},H=q[2]?X0(q[2]):{value:0,unit:""};M($,"x",G.value,G.unit),M($,"y",z.value,z.unit),M($,"z",H.value,H.unit);break}case"translateX":{let G=q[0]?X0(q[0]):{value:0,unit:""};M($,"x",G.value,G.unit);break}case"translateY":{let G=q[0]?X0(q[0]):{value:0,unit:""};M($,"y",G.value,G.unit);break}case"translateZ":{let G=q[0]?X0(q[0]):{value:0,unit:""};M($,"z",G.value,G.unit);break}case"scale":{let G=q[0]?parseFloat(q[0]):1,z=q[1]?parseFloat(q[1]):G;M($,"scaleX",G),M($,"scaleY",z);break}case"scale3d":{let G=q[0]?parseFloat(q[0]):1,z=q[1]?parseFloat(q[1]):1,H=q[2]?parseFloat(q[2]):1;M($,"scaleX",G),M($,"scaleY",z),M($,"scaleZ",H);break}case"scaleX":{let G=q[0]?parseFloat(q[0]):1;M($,"scaleX",G);break}case"scaleY":{let G=q[0]?parseFloat(q[0]):1;M($,"scaleY",G);break}case"scaleZ":{let G=q[0]?parseFloat(q[0]):1;M($,"scaleZ",G);break}case"rotate":M($,"rotate",q[0]?D0(q[0]):0,"deg");break;case"rotateX":M($,"rotateX",q[0]?D0(q[0]):0,"deg");break;case"rotateY":M($,"rotateY",q[0]?D0(q[0]):0,"deg");break;case"rotateZ":M($,"rotateZ",q[0]?D0(q[0]):0,"deg");break;case"skew":{let G=q[0]?D0(q[0]):0,z=q[1]?D0(q[1]):0;M($,"skewX",G,"deg"),M($,"skewY",z,"deg");break}case"skewX":M($,"skewX",q[0]?D0(q[0]):0,"deg");break;case"skewY":M($,"skewY",q[0]?D0(q[0]):0,"deg");break;case"perspective":{let G=q[0]?X0(q[0]):{value:0,unit:""};M($,"perspective",G.value,G.unit);break}default:break}}}function gJ(J,$,Q,Z,j,q,G,z,H,N,K,Y,_,X){if(_){let Q0=Math.hypot(J,$),I0=J*j-$*Z,r0=Q0!==0?I0/Q0:0,j0=Q0!==0?Math.atan2($,J):0,Y0=Q0!==0?Math.atan2(J*Z+$*j,Q0*Q0):0;if(M(X,"x",N,"px"),M(X,"y",K,"px"),M(X,"scaleX",Q0||1),M(X,"scaleY",r0||1),M(X,"rotate",y0(j0,"rad"),"deg"),Math.abs(Y0)>0.000001)M(X,"skewX",y0(Y0,"rad"),"deg");return}let B=Math.hypot(J,$,Q)||1,U=Math.hypot(Z,j,q)||1,W=Math.hypot(G,z,H)||1,O=J/B,F=$/B,A=Q/B,L=Z/U,R=j/U,h=q/U,J0=G/W,i=z/W,n=H/W,f=Math.sqrt(O*O+L*L),$0=f<0.000001,a=0,r=0,w0=0;if(!$0)a=Math.atan2(i,n),r=Math.atan2(-J0,f),w0=Math.atan2(L,O);else a=Math.atan2(-h,R),r=Math.atan2(-J0,f),w0=0;M(X,"x",N,"px"),M(X,"y",K,"px"),M(X,"z",Y,"px"),M(X,"scaleX",B),M(X,"scaleY",U),M(X,"scaleZ",W),M(X,"rotateX",y0(a,"rad"),"deg"),M(X,"rotateY",y0(r,"rad"),"deg"),M(X,"rotateZ",y0(w0,"rad"),"deg")}function i7(J,$){if(!J||J==="none")return;if(typeof DOMMatrixReadOnly<"u"){let Z=new DOMMatrixReadOnly(J);gJ(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);gJ(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);gJ(Z[0],Z[1],0,Z[2],Z[3],0,0,0,1,Z[4],Z[5],0,!0,$)}}function n7(J,$){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let Z=J.style.transform;if(Z&&Z!=="none"){s7(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")i7(q,$),$.cachedString=q}}catch{}}function sJ(J){let $=v0.get(J);if(!$){let Q=new Float32Array(14);Q[8]=1,Q[9]=1,Q[10]=1,Q[11]=1,$={values:Q,units:[...lJ],dirty:0,used:0,cachedString:"",pinDirty:!1},n7(J,$),v0.set(J,$)}return $}function x(J,$,Q,Z){let j=sJ(J),q=XJ[$];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 iJ(J,$){let Q=sJ(J),Z=XJ[$];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 nJ(J,$){let Q=sJ(J),Z=XJ[$];if(Z===void 0)return"";return Q.units[Z]||lJ[Z]||""}function oJ(J){return J===0?"0":`${Math.round(J)}px`}function x6(J,$,Q){return`translate3d(${oJ(J)}, ${oJ($)}, ${oJ(Q)})`}function BJ(J,$,Q,Z){KJ.set(J,{x:$,y:Q,z:Z});let j=v0.get(J);if(j)j.pinDirty=!0}function T0(J){let $=KJ.has(J);if(KJ.delete(J),$){let Q=v0.get(J);if(Q)Q.pinDirty=!0}}function C(J){let $=v0.get(J),Q=KJ.get(J);if(!$){if(Q&&(Q.x!==0||Q.y!==0||Q.z!==0))return x6(Q.x,Q.y,Q.z);return""}if($.dirty===0&&!$.pinDirty&&$.cachedString)return $.cachedString;let{values:Z,units:j}=$;w.length=0;let q=$.used,G=Z[0];if(G!==0){let L=j[0];w.push(`perspective(${G}${L})`)}let z=Z[1],H=Z[2],N=Z[3],K=j[1],Y=j[2],_=j[3],X=q&2,B=q&4,U=q&8;if(z!==0||H!==0||N!==0||X||B||U){let L=K===Y&&(N===0&&!U||Y===_);if(N!==0||U)if(L)w.push(`translate3d(${z}${K}, ${H}${Y}, ${N}${_})`);else{if(z!==0||X)w.push(`translateX(${z}${K})`);if(H!==0||B)w.push(`translateY(${H}${Y})`);w.push(`translateZ(${N}${_})`)}else if(L&&(z!==0||X)&&(H!==0||B))w.push(`translate(${z}${K}, ${H}${Y})`);else{if(z!==0||X)w.push(`translateX(${z}${K})`);if(H!==0||B)w.push(`translateY(${H}${Y})`)}}if(Z[4]!==0||q&16)w.push(`rotate(${Z[4]}deg)`);if(Z[5]!==0||q&32)w.push(`rotateX(${Z[5]}deg)`);if(Z[6]!==0||q&64)w.push(`rotateY(${Z[6]}deg)`);if(Z[7]!==0||q&128)w.push(`rotateZ(${Z[7]}deg)`);let W=q&256,O=q&512,F=q&1024;if(Z[8]!==1||W)w.push(`scale(${Z[8]})`);else if(Z[9]!==1||Z[10]!==1||O||F)w.push(`scaleX(${Z[9]})`),w.push(`scaleY(${Z[10]})`);if(Z[11]!==1||q&2048)w.push(`scaleZ(${Z[11]})`);if(Z[12]!==0||q&4096)w.push(`skewX(${Z[12]}deg)`);if(Z[13]!==0||q&8192)w.push(`skewY(${Z[13]}deg)`);let A=w.join(" ");if(Q&&(Q.x!==0||Q.y!==0||Q.z!==0)){let L=x6(Q.x,Q.y,Q.z);$.cachedString=A?`${L} ${A}`:L}else $.cachedString=A;return $.dirty=0,$.pinDirty=!1,$.cachedString}function y(J,$=!1){if(v0.delete(J),$&&J instanceof HTMLElement)J.style.transform=""}var aJ=new Set,_J=new Map,WJ=!1;function B0(J){aJ.add(J),WJ=!0}function k0(J,$,Q){let Z=_J.get(J);if(!Z)Z=new Map,_J.set(J,Z);Z.set($,Q),WJ=!0}function rJ(){if(!WJ)return;for(let J of aJ){let $=J;if($.style){let Q=C(J);$.style.transform=Q}}aJ.clear();for(let[J,$]of _J){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{}}_J.clear(),WJ=!1}var C0=!1;function F0(){return C0}function e0(J){if(C0){J();return}C0=!0;try{J(),rJ()}finally{C0=!1}}class u{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(!u.instance)u.instance=new u;return u.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($),C0=!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{rJ()}catch(Z){console.error("[Motion] Uncaught error in render batch flush:",Z)}if(C0=!1,this._isRunning&&typeof requestAnimationFrame<"u")this.rafId=requestAnimationFrame(this.tick);else this.rafId=null};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 C0}getListenerCount(){return this.listeners.length}removeAll(){this.listeners=[],this.stop()}}var E6=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"]),w6=new Set(["rotate","rotateX","rotateY","rotateZ","skewX","skewY"]),C6=new Set(["transformOrigin","backgroundPosition","perspectiveOrigin"]),UJ=new Set(["transformOrigin","perspectiveOrigin"]),S6=new Set(["pointerEvents","visibility"]),P6=new Set(["opacity","scale","scaleX","scaleY","scaleZ","z-index","zIndex"]),y6=new Set(["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor","textDecorationColor","caretColor","fill","stroke"]),v6=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"]),tJ=new Set(["width","height"]);function V(J){return E6.has(J)}function z0(J){return y6.has(J)}function o(J){return J==="filter"}function A0(J){return J==="drawSVG"}function h0(J){return J==="path"}function f0(J){return J==="clip-path"||J==="clipPath"}function OJ(J){return C6.has(J)}function IJ(J){return S6.has(J)}function eJ(J){return UJ.has(J)}function p(J){return J.startsWith("--")}function u0(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=I.color;if(Q)return Q.parseColor($)!==null;return v6.has($)}function S(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 l(J){if(P6.has(J))return"";if(w6.has(J))return"deg";if(V6.has(J))return"px";return""}function T6(J){if(J==="opacity")return 1;if(J.startsWith("scale"))return 1;return 0}function H0(J,$){if(!(J instanceof Element)){let Q=J;if($ in Q)return Q[$];return a7($)}if(V($))return iJ(J,$);try{if(typeof window<"u"&&window.getComputedStyle){let Z=window.getComputedStyle(J).getPropertyValue(v($));if(Z)return S(Z).value}}catch(Q){}return T6($)}function h6(J,$,Q,Z){if(!Z||Z==="px")return Q;if(typeof window>"u"||!window.getComputedStyle)return Q;let j=J,q=v($);try{let G=j.style.getPropertyValue(q);j.style.setProperty(q,`100${Z}`);let z=window.getComputedStyle(J),H=parseFloat(z.getPropertyValue(q));if(G)j.style.setProperty(q,G);else j.style.removeProperty(q);if(H&&isFinite(H)&&H!==0)return Q/H*100}catch{}return Q}function d0(J,$,Q){let Z=H0(J,$);if(J instanceof Element&&Q&&Q!=="px")return h6(J,$,Z,Q);return Z}function J6(J,$){let Q=J,Z=v($);if(V($)){let j=Q.style.transform;y(J),Q.style.transform="";let q=iJ(J,$);return Q.style.transform=j,y(J),{value:q,unit:l($)}}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=S(G);return{value:z.value,unit:z.unit}}}}catch(j){}return{value:T6($),unit:l($)}}function a7(J){if(J.startsWith("scale"))return 1;return 0}function v(J){return J.replace(/[A-Z]/g,($)=>`-${$.toLowerCase()}`)}function $6(J){if(typeof J==="string")return/^[+\-*/]=/.test(J);return!1}function Q6(J){let $=J.match(/^([+\-*/])=/);return $?$[0]:null}function Z6(J,$,Q){switch(Q){case"+=":return J+$;case"-=":return J-$;case"*=":return J*$;case"/=":return $!==0?J/$:J;default:return $}}var W0=null,c0=null,r7=100,_0=new Map;function t7(J){let $=_0.get(J);if($!==void 0)_0.delete(J),_0.set(J,$);return $}function e7(J,$){if(_0.has(J))_0.delete(J);while(_0.size>=r7){let Q=_0.keys().next().value;if(Q!==void 0)_0.delete(Q);else break}_0.set(J,$)}function f6(J){return/^\s*[Mm]/.test(J)}function u6(){if(c0)return c0;if(typeof document>"u")throw Error("PathParser requires a browser environment");return W0=document.createElementNS("http://www.w3.org/2000/svg","svg"),W0.style.cssText="position:absolute;width:0;height:0;overflow:hidden;visibility:hidden;",W0.setAttribute("aria-hidden","true"),c0=document.createElementNS("http://www.w3.org/2000/svg","path"),W0.appendChild(c0),document.body.appendChild(W0),c0}function d6(J){if(J instanceof Element)return J.getAttribute("d");if(typeof J==="string"){if(f6(J))return J;if(typeof document<"u"){let $=document.querySelector(J);if($)return $.getAttribute("d")}}return null}function c6(J){let $=t7(J);if($!==void 0)return $;try{let Q=u6();Q.setAttribute("d",J);let Z=Q.getTotalLength();return e7(J,Z),Z}catch{return 0}}function j6(J,$,Q=!1){try{let Z=u6();Z.setAttribute("d",J);let j=Z.getTotalLength(),q=Math.max(0,Math.min(1,$)),G=j*q,z=Z.getPointAtLength(G),H=0;if(Q)H=J9(Z,G,j);return{x:z.x,y:z.y,angle:H}}catch{return{x:0,y:0,angle:0}}}function J9(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),H=z.x-G.x,N=z.y-G.y;return Math.atan2(N,H)*(180/Math.PI)}function FJ(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 AJ(J){let $=null;if(J instanceof Element)$=J;else if(typeof J==="string"&&!f6(J)&&typeof document<"u")$=document.querySelector(J);if(!$)return{x:1,y:1};let Q=$;if(typeof Q.getScreenCTM==="function"){let Z=Q.getScreenCTM();if(Z){let j=Math.hypot(Z.a,Z.b),q=Math.hypot(Z.c,Z.d);if(j>0&&q>0&&isFinite(j)&&isFinite(q))return{x:j,y:q}}}if(typeof Q.getBBox==="function"&&typeof Q.getBoundingClientRect==="function")try{let Z=Q.getBBox(),j=Q.getBoundingClientRect();if(Z.width>0&&Z.height>0)return{x:j.width/Z.width,y:j.height/Z.height}}catch{}return{x:1,y:1}}function LJ(J,$,Q,Z={x:1,y:1}){if(!J)return{x:0,y:0};let j=null;if(J instanceof Element)j=J;else if(typeof J==="string"&&typeof document<"u")j=document.querySelector(J);if(!j)return{x:0,y:0};let q=j6($,0,!1),G={x:q.x*Z.x,y:q.y*Z.y};if(Q&&Q instanceof HTMLElement){let z=Q.style.transform,H=z&&z!=="none"&&z!=="";if(H)Q.style.transform="none";let N=Q.getBoundingClientRect(),K=j.getScreenCTM?.();if(K&&isFinite(K.e)&&isFinite(K.f)){if(H)Q.style.transform=z;return{x:K.e-N.left,y:K.f-N.top}}let Y=j.getBoundingClientRect();if(H)Q.style.transform=z;let _=Y.left+Y.width/2-(N.left+N.width/2),X=Y.top+Y.height/2-(N.top+N.height/2);return{x:_-G.x,y:X-G.y}}return{x:-G.x,y:-G.y}}function m6(){if(W0&&W0.parentNode)W0.parentNode.removeChild(W0);W0=null,c0=null,_0.clear()}function p6(J){return typeof J==="string"&&J.trim().toLowerCase()==="auto"}function $9(J,$){if(!tJ.has($))return 0;let Q=J,Z=v($);try{let j=Q.style.getPropertyValue(Z);Q.style.setProperty(Z,"auto");let q=$==="width"?Q.offsetWidth:Q.offsetHeight;if(j)Q.style.setProperty(Z,j);else Q.style.removeProperty(Z);return q}catch{return 0}}function g6(J){return typeof J==="string"&&/(?:^|[^a-z])(var|calc|clamp|min|max|env)\s*\(/i.test(J)}function Q9(J){return!z0(J)&&!o(J)&&!A0(J)&&!f0(J)&&!h0(J)&&!OJ(J)&&!IJ(J)&&!V(J)}var Z9="letter-spacing";function o6(J,$,Q){if(typeof window>"u"||!window.getComputedStyle)return null;let Z=J,j=p($)?Z9:v($);try{let q=Z.style.getPropertyValue(j),G=Z.style.getPropertyPriority(j);Z.style.setProperty(j,Q);let z=window.getComputedStyle(J).getPropertyValue(j);if(q)Z.style.setProperty(j,q,G);else Z.style.removeProperty(j);let H=parseFloat(z);return isFinite(H)?H:null}catch{return null}}function j9(J,$,Q,Z){let j=I.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 q9(J,$,Q,Z){let j=I.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 H=j.mergeFilterArrays(z,G);return{type:"filter",property:$,isTransform:!1,startFilters:H.start,endFilters:H.end}}function G9(J,$,Q,Z){if(u0(Q)||Z!==void 0&&u0(Z)){let H=I.color;if(H){let N=String(Q),K=H.parseColor(N,J),Y=Z!==void 0?H.parseColor(String(Z),J):z9(J,$);return{type:"color",property:$,isTransform:!1,startColor:Y||new Float32Array([0,0,0,1]),endColor:K||new Float32Array([0,0,0,1])}}}let q,G,z;if(Z!==void 0&&Q!==void 0){let H=S(Z),N=S(Q);q=H.value,G=N.value,z=N.unit||H.unit}else if(Z!==void 0){let H=S(Z);q=H.value,G=l6(J,$),z=H.unit}else{let H=S(Q);q=l6(J,$),G=H.value,z=H.unit}return{type:"scalar",property:$,isTransform:!1,startValue:q,endValue:G,unit:z}}function z9(J,$){let Q=I.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 l6(J,$){try{if(typeof window<"u"&&window.getComputedStyle){let Z=window.getComputedStyle(J).getPropertyValue($).trim();if(Z)return S(Z).value}}catch{}return 0}function H9(J,$,Q,Z){let j=I.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 R0(J,$="%"){return{value:0,unit:J?.unit||$}}function s6(J){switch(J.shape){case"inset":return{shape:"inset",components:[R0(J.components[0]),R0(J.components[1]),R0(J.components[2]),R0(J.components[3]),...J.components.slice(4)],extras:J.extras};case"circle":return{shape:"circle",components:[{value:150,unit:"%"},J.components[1]??{value:50,unit:"%"},J.components[2]??{value:50,unit:"%"}],extras:J.extras};case"ellipse":return{shape:"ellipse",components:[{value:150,unit:"%"},{value:150,unit:"%"},J.components[2]??{value:50,unit:"%"},J.components[3]??{value:50,unit:"%"}],extras:J.extras};case"rect":return{shape:"rect",components:[R0(J.components[0]),{value:100,unit:J.components[1]?.unit||"%"},{value:100,unit:J.components[2]?.unit||"%"},R0(J.components[3]),...J.components.slice(4)],extras:J.extras};case"xywh":return{shape:"xywh",components:[R0(J.components[0]),R0(J.components[1]),{value:100,unit:J.components[2]?.unit||"%"},{value:100,unit:J.components[3]?.unit||"%"},...J.components.slice(4)],extras:J.extras};default:return J}}function N9(J,$,Q,Z){let j=I.clipPath;if(!j)return null;let q;if(Q===void 0||Q==="")q=j.getCurrentClipPath(J);else q=j.parseClipPath(String(Q));let G;if(Z!==void 0)G=j.parseClipPath(String(Z));else G=j.getCurrentClipPath(J);let z=G,H=q;if(!z&&!H)return null;if(!z)z=s6(H);if(!H)H=s6(z);return{type:"clipPath",property:$,isTransform:!1,startClipPath:z,endClipPath:H}}function Y9(J,$,Q,Z){let j=Q,q=Z,G=j?.target?j:q;if(!G?.target)return null;let z=d6(G.target);if(!z)return null;let H=c6(z);if(H===0)return null;let N,K;if(j?.target&&q?.target)N=q.start??0,K=j.end??1;else if(j?.target)N=j.start??0,K=j.end??1;else N=q.start??0,K=q.end??1;let Y=j?.rotate??q?.rotate??!1,_=j?.alignAt??q?.alignAt??[50,50],X=FJ(J,_),B=j?.align??q?.align,U=B?AJ(G.target):{x:1,y:1},W=LJ(B,z,J,U);return{type:"path",property:$,isTransform:!1,pathData:z,pathLength:H,startProgress:N,endProgress:K,rotate:Y,alignOffset:X,pathOffset:W,pathScale:U,alignTarget:B,alignAt:_,pathTarget:G.target}}function i6(J,$){try{if(typeof window<"u"&&window.getComputedStyle){let Q=window.getComputedStyle(J).getPropertyValue(v($)).trim();if(Q)return Q}}catch{}return""}function K9(J,$,Q,Z){let j=Q!==void 0&&Q!=="",q=Z!==void 0&&Z!=="",G,z,H=UJ.has($);if(q&&j)G=String(Z),z=String(Q);else if(q)G=String(Z),z=H?G:i6(J,$)||G;else z=String(Q),G=H?z:i6(J,$)||z;return{type:"string",property:$,isTransform:!1,startString:G,endString:z}}function JJ(J,$,Q,Z){let j=J instanceof Element;if(j&&Q9($)){let B=g6(Q)&&!u0(Q),U=Z!==void 0&&g6(Z)&&!u0(Z);if(B||U){let W=B?o6(J,$,Q):null,O=U?o6(J,$,Z):null;if(W!==null||O!==null){let F=W!==null?`${W}px`:Q,A=O!==null?`${O}px`:Z;return JJ(J,$,F,A)}}}if(j&&(OJ($)||IJ($)))return K9(J,$,Q,Z);if(j&&p($))return G9(J,$,Q,Z);if(j&&z0($)){let B=j9(J,$,Q,Z);if(B)return B}if(j&&o($)){let B=q9(J,$,Q,Z);if(B)return B}if(j&&A0($)){let B=H9(J,$,Q,Z);if(B)return B}if(j&&f0($)){let B=N9(J,$,Q,Z);if(B)return B}if(j&&h0($)){let B=Y9(J,$,Q,Z);if(B)return B}let q=p6(Q),G=Z!==void 0&&p6(Z);if(j&&(q||G)&&tJ.has($)){let B=$9(J,$);return JJ(J,$,q?B:Q,G?B:Z)}let z=V($),H=Z===void 0&&$6(Q),N,K,Y,_,X;if(Z!==void 0){let B=S(Z);if(Q!==void 0){let U=S(Q);N=B.value,K=U.value,Y=U.unit||B.unit||l($);let W=B.unit||Y,O=U.unit||Y;if(!z&&W!==O)_=W,X=O}else N=B.value,Y=B.unit||l($),K=d0(J,$,Y)}else if(H){let B=Q6(Q),U=H0(J,$),W=S(Q);N=U,K=Z6(U,W.value,B),Y=W.unit||l($)}else{let B=S(Q);Y=B.unit||l($),N=d0(J,$,Y),K=B.value}return{type:"scalar",property:$,isTransform:z,startValue:N,endValue:K,unit:Y,startUnit:_,endUnit:X}}function n6(){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 q6=n6(),MJ=new WeakMap,G6=n6();function a6(J){if(V(J))return["transform"];if(o(J))return["filter"];if(A0(J))return["strokeDasharray","strokeDashoffset"];return[J]}function X9(J,$){if(V($)&&!MJ.has(J)){if(J instanceof HTMLElement||J instanceof SVGElement){let Z=J.style.transform;MJ.set(J,Z||null)}}let Q=a6($);for(let Z of Q)q6.register(J,Z)}function B9(J,$){for(let Q of $)X9(J,Q)}function _9(J){q6.clearRegistry(J),MJ.delete(J)}function W9(J,$){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let Q=new Set;for(let Z of $)for(let j of a6(Z))Q.add(j);for(let Z of Q)if(p(Z))J.style.removeProperty(Z);else J.style[Z]=""}function U9(J){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let $=q6.get(J);if(!$||$.size===0)return;for(let Q of $){if(Q==="transform"){let Z=MJ.get(J);if(Z!==void 0){if(Z)J.style.transform=Z;else J.style.removeProperty("transform");continue}}if(p(Q))J.style.removeProperty(Q);else J.style[Q]=""}}function O9(J){U9(J),_9(J)}function $J(J,$){G6.registerMany(J,$)}function z6(J){G6.clearRegistry(J)}function I9(J){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let $=G6.get(J);if(!$||$.size===0)return;for(let Q of $)J.style[Q]=""}function F9(J){I9(J),z6(J)}I.styleReset={registerAnimatedProps:B9,clearAnimationStylesForProps:W9,clearAnimationStylesAndUnregister:O9,clearPinStylesAndUnregister:F9};class d{static _registry=new Map;static _users=new Map;static getOrCreate(J,$){let Q=d._registry.get($);if(!Q)Q=new d(J),d._registry.set($,Q);let Z=d._users.get($);if(!Z)Z=new Set,d._users.set($,Z);return Z.add(J),Q}static release(J,$){let Q=d._users.get($);if(!Q)return;if(Q.delete(J),Q.size===0){let Z=d._registry.get($);d._registry.delete($),d._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;_gridPlacement=null;_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._applyFixedState("before");let H=!1;if(z&&this._spacer){if(J.style.width="",J.style.height="",J.style.boxSizing="",this._spacer.style.width="",this._spacer.style.height="",this._spacer.parentNode)this._spacer.parentNode.insertBefore(J,this._spacer),H=!0}let N=z&&this._isBodyPin?document.documentElement.style.height:null;if(N!==null)document.documentElement.style.height=this._originalHtmlHeight;let K=this._measurePinRect(J);if(H&&this._spacer)this._spacer.appendChild(J);let Y=K.height;if(N!==null)document.documentElement.style.height=N;let _=z&&this._spacer?window.getComputedStyle(this._spacer):window.getComputedStyle(J);if(this._elementHeight=Y,!z)this._originalStyles={position:J.style.position,top:J.style.top,left:J.style.left,width:J.style.width,height:J.style.height,boxSizing:J.style.boxSizing,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=K.left,this._width=K.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 X=this._resolvePinSpacing(),B=window.getComputedStyle(J),U=B.display,W=B.flexDirection,O=z&&this._spacer?.parentElement?this._spacer.parentElement:J.parentElement,F=O?/^(inline-)?flex$/.test(getComputedStyle(O).display):!1,A=O?/^(inline-)?grid$/.test(getComputedStyle(O).display):!1;if(!z&&A){let i=(r)=>!!r&&r!=="auto"&&r!=="auto / auto",n=B.gridColumn,f=B.gridRow,$0=B.alignSelf,a=B.justifySelf;this._gridPlacement=i(n)||i(f)||$0&&$0!=="auto"||a&&a!=="auto"?{column:i(n)?n:"",row:i(f)?f:"",alignSelf:$0&&$0!=="auto"?$0:"",justifySelf:a&&a!=="auto"?a:""}:null}let L=this._gridPlacement?[this._gridPlacement.column&&`grid-column: ${this._gridPlacement.column};`,this._gridPlacement.row&&`grid-row: ${this._gridPlacement.row};`,this._gridPlacement.alignSelf&&`align-self: ${this._gridPlacement.alignSelf};`,this._gridPlacement.justifySelf&&`justify-self: ${this._gridPlacement.justifySelf};`].filter(Boolean).join(`
2
+ `):"",R=/^(inline-)?flex$/.test(U),h=`
3
+ display: ${U};
4
+ ${R?`flex-direction: ${W};`:""}
4
5
  box-sizing: content-box;
5
- width: ${H.width}px;
6
- height: ${H.height}px;
7
- margin-top: ${K.marginTop};
8
- margin-left: ${K.marginLeft};
9
- margin-right: ${K.marginRight};
6
+ width: ${K.width}px;
7
+ height: ${Y}px;
8
+ margin-top: ${_.marginTop};
9
+ margin-left: ${_.marginLeft};
10
+ margin-right: ${_.marginRight};
10
11
  overflow: visible;
11
- ${B?"flex-shrink: 0;":""}
12
- `;if(Y==="padding")F+=`padding-bottom: ${this._pinDistance}px;`,F+=`margin-bottom: ${K.marginBottom};`;else if(Y==="margin"){let L=parseFloat(K.marginBottom)||0,k=G?L-z:L;F+=`margin-bottom: ${k+this._pinDistance}px;`}else F+=`margin-bottom: ${K.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=F,this._spacer.setAttribute("data-scrolltrigger-spacer",String(this._id));let A=this._spacer.getBoundingClientRect();this._fixedLeft=A.left,this._width=A.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._applyFixedState($),this._currentState=$}else if($!==this._currentState||$==="pinned")this._updateTransform($,J),this._currentState=$}cleanup(){if(this._element&&f._registry.get(this._element)===this)f._registry.delete(this._element),f._users.delete(this._element);if(this._element&&this._originalStyles){let J=this._element;v0(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="",J6(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"}_applyFixedState(J){let $=this._element;if(!$)return;let Q=$.style.transition;$.style.transition="none",$.offsetHeight;try{this._updateFixed(J),$.offsetHeight}finally{$.style.transition=Q}}_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||"",v0($),$.style.transform=C($),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",v0($),$.style.transform=C($),this._isBodyPin)$J($,["position","top","left","width","zIndex","transform","marginTop"]);else $J($,["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)v0($),$.style.transform=C($),$.style.marginTop=`${this._pinDistance}px`;else $.style.marginTop="0",$.style.marginLeft="0",_J($,0,this._pinDistance,0),$.style.transform=C($);$.style.zIndex=this._originalStyles?.zIndex||"",this._restoreFixedBreakingAncestors()}}_updateTransform(J,$){let Q=this._element;if(J==="before")Q.style.zIndex=this._originalStyles?.zIndex||"",v0(Q),Q.style.transform=C(Q);else if(J==="pinned"){let Z=Math.round($-this._pinStart);Q.style.zIndex="100",_J(Q,0,Z,0),Q.style.transform=C(Q),$J(Q,["transform","zIndex"])}else Q.style.zIndex=this._originalStyles?.zIndex||"",_J(Q,0,this._pinDistance,0),Q.style.transform=C(Q),$J(Q,["transform","zIndex"])}}function m(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 G=q[1],N=q[2]==="-"?-1:1,H=parseFloat(q[3]),K=q[4]||"px",Y=0;switch(G){case"top":Y=0;break;case"center":Y=$/2;break;case"bottom":Y=$;break}let W=g6(H,K,$,Q,Z);return Y+N*W}switch(j){case"top":return 0;case"center":return $/2;case"bottom":return $}let z=j.match(/^(-?\d+(?:\.\d+)?)(px|%|vh|vw)?$/);if(z){let G=parseFloat(z[1]),N=z[2]||"px";return g6(G,N,$,Q,Z)}return 0}function g6(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 $6{_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,z=J.viewportHeight,G=this._startConfig.split(" "),N=m(G[1]||"top",z,z),H=this._endConfig.startsWith("+=")?N:m(this._endConfig.split(" ")[1]||"top",z,z);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 K=(U,B,O)=>{let F=document.createElement("div");F.setAttribute("data-marker",U),F.style.cssText=`
12
+ ${F?"flex-shrink: 0;":""}
13
+ ${L}
14
+ `;if(X==="padding")h+=`padding-bottom: ${this._pinDistance}px;`,h+=`margin-bottom: ${_.marginBottom};`;else if(X==="margin"){let i=parseFloat(_.marginBottom)||0,n=z?i-G:i;h+=`margin-bottom: ${n+this._pinDistance}px;`}else h+=`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=h,this._spacer.setAttribute("data-scrolltrigger-spacer",String(this._id));let J0=this._spacer.getBoundingClientRect();this._fixedLeft=J0.left,this._width=J0.width,J.style.boxSizing="border-box",J.style.width=`${this._width}px`,J.style.height=`${this._elementHeight}px`}this._currentState="before"}_measurePinRect(J){let $=J.style.transform,Q=J.style.transition;J.style.transition="none",J.style.transform="none";try{let Z=J.getBoundingClientRect();if(this._isBodyPin||Z.width>0&&Z.height>0)return Z;let j=J.style.position,q=J.style.visibility;J.style.position="absolute",J.style.visibility="hidden";let G=J.getBoundingClientRect();return J.style.position=j,J.style.visibility=q,G.width>0&&G.height>0?G:Z}finally{J.style.transform=$,J.style.transition=Q}}update(J){if(!this._element)return;let $=J<this._pinStart?"before":J<this._pinEnd?"pinned":"after";if(this._useFixedPin){if($!==this._currentState)this._applyFixedState($),this._currentState=$}else if($!==this._currentState||$==="pinned")this._updateTransform($,J),this._currentState=$}cleanup(){if(this._element&&d._registry.get(this._element)===this)d._registry.delete(this._element),d._users.delete(this._element);if(this._element&&this._originalStyles){let J=this._element;T0(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.height=this._originalStyles.height,J.style.boxSizing=this._originalStyles.boxSizing,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="",z6(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._gridPlacement=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"}_applyFixedState(J){let $=this._element;if(!$)return;let Q=$.style.transition;$.style.transition="none",$.offsetHeight;try{this._updateFixed(J),$.offsetHeight}finally{$.style.transition=Q}}_updateFixed(J){let $=this._element;if(J==="before"){if($.style.position=this._originalStyles?.position||"",$.style.top=this._originalStyles?.top||"",$.style.left=this._originalStyles?.left||"",this._isBodyPin)$.style.width=this._originalStyles?.width||"",$.style.height=this._originalStyles?.height||"";if(this._isBodyPin)$.style.marginTop=this._originalStyles?.marginTop||"";else $.style.marginTop="0",$.style.marginLeft="0";$.style.zIndex=this._originalStyles?.zIndex||"",T0($),$.style.transform=C($),this._restoreFixedBreakingAncestors()}else if(J==="pinned"){if(this._overrideFixedBreakingAncestors(),$.style.position="fixed",$.style.top=`${this._fixedTop}px`,$.style.left=`${this._fixedLeft}px`,this._isBodyPin)$.style.width=`${this._width}px`,$.style.height=`${this._elementHeight}px`;if(this._isBodyPin)$.style.marginTop=this._originalStyles?.marginTop||"";else $.style.marginTop="0",$.style.marginLeft="0";if($.style.zIndex=this._originalStyles?.zIndex||"",T0($),$.style.transform=C($),this._isBodyPin)$J($,["position","top","left","width","height","zIndex","transform","marginTop"]);else $J($,["position","top","left","width","height","marginTop","marginLeft","zIndex","transform"])}else{if($.style.position=this._originalStyles?.position||"",$.style.top=this._originalStyles?.top||"",$.style.left=this._originalStyles?.left||"",this._isBodyPin)$.style.width=this._originalStyles?.width||"",$.style.height=this._originalStyles?.height||"";if(this._isBodyPin)T0($),$.style.transform=C($),$.style.marginTop=`${this._pinDistance}px`;else $.style.marginTop="0",$.style.marginLeft="0",BJ($,0,this._pinDistance,0),$.style.transform=C($);$.style.zIndex=this._originalStyles?.zIndex||"",this._restoreFixedBreakingAncestors()}}_updateTransform(J,$){let Q=this._element;if(J==="before")Q.style.zIndex=this._originalStyles?.zIndex||"",T0(Q),Q.style.transform=C(Q);else if(J==="pinned"){let Z=Math.round($-this._pinStart);Q.style.zIndex=this._originalStyles?.zIndex||"",BJ(Q,0,Z,0),Q.style.transform=C(Q),$J(Q,["transform","zIndex"])}else Q.style.zIndex=this._originalStyles?.zIndex||"",BJ(Q,0,this._pinDistance,0),Q.style.transform=C(Q),$J(Q,["transform","zIndex"])}}function N0(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],H=q[2]==="-"?-1:1,N=parseFloat(q[3]),K=q[4]||"px",Y=0;switch(z){case"top":Y=0;break;case"center":Y=$/2;break;case"bottom":Y=$;break}let _=r6(N,K,$,Q,Z);return Y+H*_}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]),H=G[2]||"px";return r6(z,H,$,Q,Z)}return 0}function r6(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 H6{_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(" "),H=N0(z[1]||"top",G,G),N=this._endConfig.startsWith("+=")?H:N0(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 K=(U,W,O)=>{let F=document.createElement("div");F.setAttribute("data-marker",U),F.style.cssText=`
13
15
  position: absolute;
14
16
  ${O}: 0;
15
17
  height: 1px;
16
18
  width: 50px;
17
- background: ${B};
19
+ background: ${W};
18
20
  pointer-events: none;
19
21
  `;let A=document.createElement("span");return A.textContent=U,A.style.cssText=`
20
22
  position: absolute;
21
23
  ${O}: 0;
22
24
  top: 2px;
23
- background: ${B};
24
- color: ${B==="lime"?"#000":"#fff"};
25
+ background: ${W};
26
+ color: ${W==="lime"?"#000":"#fff"};
25
27
  padding: 1px 3px;
26
28
  font-size: ${j};
27
29
  font-family: monospace;
28
30
  white-space: nowrap;
29
31
  border-radius: 2px;
30
32
  line-height: 1.2;
31
- `,F.appendChild(A),F},Y=K("scroller-start",Q,"right"),W=K("scroller-end",Z,"right"),X=K("start",Q,"left"),_=K("end",Z,"left");if(!this._triggerElement)X.style.display="none",_.style.display="none";if(this._markerContainer.appendChild(Y),this._markerContainer.appendChild(W),this._markerContainer.appendChild(X),this._markerContainer.appendChild(_),this._markers={scrollerStart:Y,scrollerEnd:W,elementStart:X,elementEnd:_},q){let U=this._scroller;if(window.getComputedStyle(U).position==="static")U.style.position="relative";U.appendChild(this._markerContainer)}else document.body.appendChild(this._markerContainer),this._markerContainer.style.position="fixed";this._scrollerStartOffset=N,this._scrollerEndOffset=H,this._cacheElementPositions(z)}_cacheElementPositions(J){if(!this._triggerElement){this._cachedElPositionValid=!1;return}let $=e(this._triggerElement),Q=m(this._startConfig.split(" ")[0]||"top",$.height,J),Z=this._endConfig.startsWith("+=")?Q:m(this._endConfig.split(" ")[0]||"bottom",$.height,J);if(this._scroller!==window){let q=this._scroller.getBoundingClientRect(),z=this._scroller.scrollTop,G=$.top-q.top+z;this._cachedElStartDocTop=G+Q,this._cachedElEndDocTop=G+Z}else{let q=window.scrollY||window.pageYOffset||0,z=$.top+q;this._cachedElStartDocTop=z+Q,this._cachedElEndDocTop=z+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}}var QJ=new Map;function H9(J){if(typeof window<"u"&&J===window)return window.scrollY||window.pageYOffset||0;if(typeof Element<"u"&&J instanceof Element)return J.scrollTop;return 0}function o6(J,$){let Q=QJ.get(J);if(!Q){let Z=()=>{let j=QJ.get(J);if(!j||j.callbacks.size===0)return;let q=H9(J);e0(()=>{for(let z of j.callbacks)z(q)})};Q={callbacks:new Set,listener:Z},QJ.set(J,Q),J.addEventListener("scroll",Z,{passive:!0})}Q.callbacks.add($)}function l6(J,$){let Q=QJ.get(J);if(!Q)return;if(Q.callbacks.delete($),Q.callbacks.size===0)J.removeEventListener("scroll",Q.listener),QJ.delete(J)}class H0 extends l{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=H0._nextId++,this._scrubLag=typeof $.scrub==="number"?$.scrub:0}static _ensureLoadListener(){if(H0._loadListenerAdded||typeof window>"u")return;if(H0._loadListenerAdded=!0,document.readyState==="complete")return;window.addEventListener("load",()=>{setTimeout(()=>{for(let J of H0._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){let $=this._getFirstAnimatedElement();if($ instanceof HTMLElement)J=$}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 Element)return Z}let $=this._timeline.getFirstChildAnimation();if($){let Q=$.getTargets();if(Q.length>0&&Q[0]instanceof Element)return Q[0]}return null}_resolveTriggerElement(){if(this._config.target instanceof Element)return this._config.target;if(typeof this._config.target==="string"&&typeof document<"u"){let J=document.querySelector(this._config.target);if(J instanceof Element)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()??e($),q;if(this._scroller instanceof Element){let X=this._scroller.getBoundingClientRect();q=j.top-X.top+Z}else q=j.top+Z;let G=this._defaultStart().split(" "),N=G[0]||"top",H=G[1]||"top",K=m(N,j.height,Q),Y=m(H,Q,Q);this._triggerStart=q+K-Y;let W=this._defaultEnd();if(W.startsWith("+=")){let X=m(W.slice(2),Q,Q);this._triggerEnd=this._triggerStart+X}else{let X=W.split(" "),_=X[0]||"bottom",U=X[1]||"top",B=m(_,j.height,Q),O=m(U,Q,Q);this._triggerEnd=q+B-O}if(this._triggerEnd<=this._triggerStart)this._triggerEnd=this._triggerStart+Math.max(Q,100)}_onEnable(){this._resolveScroller();let J=this._resolvePinElement();this._calculateTriggerPositions(J),H0._activeInstances.add(this),H0._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(),z=m(j[0]||"top",J.getBoundingClientRect().height,q),N=m(j[1]||"top",q,q)-z;this._pinManager=f.getOrCreate(this._id,J),this._pinManager.setup(J,this._triggerStart,this._triggerEnd,N,this._scroller===window,this._config.pinSpacing)}if(this._config.markers&&typeof document<"u"){let Z=this._pinManager?.getElement()||this._resolveTriggerElement();this._markerManager=new $6(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=(Z)=>this._onScroll(Z),this._scroller){if(o6(this._scroller,this._scrollListener),this._initializing=!0,this._onScroll(),this._initializing=!1,this._config.scrub===!1||this._config.scrub===void 0){if(this._triggerState==="active")d(this._toggleActions[0],this._timeline);else if(this._triggerState==="after")this._timeline.progress(1),this._timeline.pause()}}}_onDisable(){if(this._scrollListener&&this._scroller)l6(this._scroller,this._scrollListener),this._scrollListener=void 0;if(this._markerManager?.cleanup(),this._markerManager=null,this._pinManager){let J=this._pinManager.getElement();if(J)f.release(this._id,J);else this._pinManager.cleanup();this._pinManager=null}this._stopSmoothScrollLoop(),H0._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,z=m(Z[0]||"top",q,j),N=m(Z[1]||"top",j,j)-z;this._pinManager.setup(J,this._triggerStart,this._triggerEnd,N,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(J=this._getScrollTop()){if(!this._enabled)return;let $=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,e0(()=>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;e0(()=>{if(Z==="active"&&j==="before")d(this._toggleActions[0],this._timeline);else if(Z==="after"&&j==="active")d(this._toggleActions[1],this._timeline);else if(Z==="active"&&j==="after")d(this._toggleActions[2],this._timeline);else if(Z==="before"&&j==="active")d(this._toggleActions[3],this._timeline);else if(Z==="after"&&j==="before")d(this._toggleActions[0],this._timeline),this._timeline.progress(1),d(this._toggleActions[1],this._timeline);else if(Z==="before"&&j==="after")d(this._toggleActions[2],this._timeline),this._timeline.progress(0),d(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)},T.getInstance().add(this._scrubTickListener,H0._SCRUB_TICKER_PRIORITY)}_stopSmoothScrollLoop(){if(this._scrubTickListener)T.getInstance().remove(this._scrubTickListener),this._scrubTickListener=null}}D.registerTrigger("scroll",H0);class s6{_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()}}D.registerPageLoadTrigger(s6);class i6 extends l{_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;_pointerMoveHandler=null;_activeTarget=null;_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)T.getInstance().remove(this._tickerCallback),this._tickerCallback=void 0;if(this._frozenRects.clear(),this._activeTarget=null,this._pointerMoveHandler)j0(this._pointerMoveHandler),this._pointerMoveHandler=null;this._cleanupListenerMap(this._listeners)}_addViewportListeners(){if(typeof window>"u")return;this._pointerMoveHandler=(J)=>{this._handleViewportMouseMove(J.clientX,J.clientY)},J0(this._pointerMoveHandler),this._state.isInside=!0}refresh(){for(let J of this._targets)this._frozenRects.set(J,this._captureDocRect(J))}_scrollX(){if(typeof window>"u")return 0;return window.scrollX??window.pageXOffset??0}_scrollY(){if(typeof window>"u")return 0;return window.scrollY??window.pageYOffset??0}_captureDocRect(J){let $=e(J);return{left:$.left+this._scrollX(),top:$.top+this._scrollY(),width:$.width,height:$.height}}_viewportRect(J){let $=J.left-this._scrollX(),Q=J.top-this._scrollY();return{left:$,top:Q,right:$+J.width,bottom:Q+J.height,width:J.width,height:J.height}}_addTargetListeners(){for(let J of this._targets)this._frozenRects.set(J,this._captureDocRect(J));if(typeof window<"u"&&typeof window.requestAnimationFrame==="function"){this._pointerMoveHandler=(J)=>{this._handleTargetPointerMove(J.clientX,J.clientY)},J0(this._pointerMoveHandler);return}this._targets.forEach((J)=>{let $=new Map,Q=(q)=>{let z=q;this._handleTargetMouseMove(J,z.clientX,z.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,$)})}_handleTargetPointerMove(J,$){let Q=this._findTargetAtPoint(J,$);if(!Q){if(this._state.isInside)this._state.isInside=!1,this._activeTarget=null,this._handleMouseLeave();return}this._state.isInside=!0,this._activeTarget=Q,this._handleTargetMouseMove(Q,J,$)}_findTargetAtPoint(J,$){for(let Q of this._targets){let Z=this._frozenRects.get(Q);if(!Z)continue;let j=this._viewportRect(Z);if(J>=j.left&&J<=j.right&&$>=j.top&&$<=j.bottom)return Q}return null}_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 z=J-j,G=$-q,N=Math.sqrt(z*z+G*G),H=Math.sqrt(j*j+q*q);this._targetState.targetDistance=1-Math.min(N/H,1)}this._applyProgress()}_handleTargetMouseMove(J,$,Q){let Z=this._frozenRects.get(J),j=Z?this._viewportRect(Z):J.getBoundingClientRect(),q=j.left+j.width/2,z=j.top+j.height/2;if(this._config.type==="axis"){let G=$-j.left,N=Q-j.top;this._targetState.targetX=Math.max(0,Math.min(1,G/j.width)),this._targetState.targetY=Math.max(0,Math.min(1,N/j.height))}else{let G=$-q,N=Q-z,H=Math.sqrt(G*G+N*N),K=Math.sqrt(Math.pow(j.width/2,2)+Math.pow(j.height/2,2));this._targetState.targetDistance=1-Math.min(H/K,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,z=Math.abs(Q-this._state.x)<0.0001&&Math.abs(Q-this._targetState.targetX)<0.0001,G=Math.abs(Z-this._state.y)<0.0001&&Math.abs(Z-this._targetState.targetY)<0.0001,N=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,!z||!G||!N)this._updateTimelineProgress()},T.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,z=1-Math.pow(1-q,Z*60);return J+j*z}_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)}}D.registerTrigger("mouseMove",i6);class ZJ extends l{_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,{...$,types:$.types??[],events:$.events??{}});this._tolerance=this._config.tolerance??1,this._dragMinimum=this._config.dragMinimum??10,this._dragMinimumSquared=this._dragMinimum*this._dragMinimum,this._wheelSpeed=this._config.wheelSpeed??1,this._scrollSpeed=this._config.scrollSpeed??1,this._stopDelay=this._config.stopDelay??150,this._preventDefault=this._config.preventDefault??!1,this._lockAxis=this._config.lockAxis??!1,this._animationStep=this._config.animationStep??0.1,this._smooth=Math.max(0,Math.min(1,this._config.smooth??0));let Q=this._config;if(Q._siblings&&Q._index!==void 0){if(this._siblings=Q._siblings,this._index=Q._index,!ZJ._sequenceStates.has(this._siblings))ZJ._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)j0(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=e(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._fireEventImmediate("Hover");else if(!Z&&this._gestureHoverActive)this._gestureHoverActive=!1,this._fireEventImmediate("HoverEnd")},J0(this._boundHoverMoveHandler)}refresh(){if(this._target===window||!this._frozenHoverRect)return;this._frozenHoverRect=e(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()}_fireEventImmediate(J){let $=this._config.events?.[J];if($)this._executeAction($,J)}_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":d(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 $=ZJ._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 z=this._siblings[j];if(z)z.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()}}D.registerTrigger("gesture",ZJ);var OJ=null,IJ=null;function Y9(J,$,Q,Z,j){if(j<=0)return`${J}${$}`;if(j>=1)return`${Q}${Z}`;let q=J*(1-j),z=Q*j,G=z<0?"-":"+";return`calc(${q}${$} ${G} ${Math.abs(z)}${Z})`}function n6(J,$,Q,Z){let j=J;if(!j.style)return;let q=I0();if(w($))if(E(J,$,Q,Z),q)G0(J);else j.style.transform=C(J);else{let z=Z?`${Q}${Z}`:`${Q}`;if(q)V0(J,$,z);else try{if(p($))j.style.setProperty($,z);else if($ in j.style)j.style[$]=z;else j.style.setProperty(h($),z)}catch{}}}function a6(J,$,Q,Z,j,q,z){let G=J;if(!G.style)return;let N=Y9(Q,Z,j,q,z);if(I0())V0(J,$,N);else try{if(p($))G.style.setProperty($,N);else if($ in G.style)G.style[$]=N;else G.style.setProperty(h($),N)}catch{}}function r6(J,$,Q,Z,j,q){let z=J;if(!z.style)return;let G=q===1?`rgb(${Math.round(Q)}, ${Math.round(Z)}, ${Math.round(j)})`:`rgba(${Math.round(Q)}, ${Math.round(Z)}, ${Math.round(j)}, ${q})`;if(I0())V0(J,$,G);else try{if(p($))z.style.setProperty($,G);else if($ in z.style)z.style[$]=G;else z.style.setProperty(h($),G)}catch{}}function t6(J,$,Q,Z){let j=J;if(!j.style)return;if(OJ||(OJ=I.filter)){let q=OJ.interpolateFilters($,Q,Z),z=OJ.filterToString(q);if(I0())V0(J,"filter",z);else j.style.filter=z}}function e6(J,$,Q,Z,j){let q=J;if(!q.style)return;if(IJ||(IJ=I.clipPath)){let z=IJ.interpolateClipPaths(Q,Z,j),G=IJ.clipPathToString(z);if(I0())V0(J,"clip-path",G),V0(J,"-webkit-clip-path",G);else q.style.setProperty("clip-path",G),q.style.setProperty("-webkit-clip-path",G)}}function J7(J,$,Q){let{pathLUT:Z,alignOffset:j,pathOffset:q,pathRotate:z}=Q;if(!Z||Z.length===0)return;let G=$*(Z.length-1),N=Math.floor(G),H=Math.min(N+1,Z.length-1),K=G-N,Y=Z[N],W=Z[H],X=Y.x+(W.x-Y.x)*K,_=Y.y+(W.y-Y.y)*K,U=(q?.x??0)+X-(j?.x??0),B=(q?.y??0)+_-(j?.y??0);if(E(J,"x",U,"px"),E(J,"y",B,"px"),z){let O=K9(Y.angle,W.angle,K);E(J,"rotate",O,"deg")}if(I0())G0(J);else J.style.transform=C(J)}function K9(J,$,Q){let Z=$-J;if(Z>180)Z-=360;if(Z<-180)Z+=360;return J+Z*Q}var Q6=null,X9=100,_9=500,B9=0.5,jJ=[],W9=50;function U9(J){for(let $=0;$<jJ.length;$++)if(jJ[$].length>=J){let Q=jJ.splice($,1)[0];return Q.length=J,Q}return Array(J)}function O9(J){if(jJ.length<W9)jJ.push(J)}class Z6{target=null;property="";startValue=0;endValue=0;change=0;unit="";startUnit=null;endUnit=null;next=null;valueType="scalar";startColor=null;endColor=null;changeColor=new Float32Array(4);startFilters=null;endFilters=null;startDraw=null;endDraw=null;pathLength=0;startClipPath=null;endClipPath=null;pathData=null;motionPathLength=0;startProgress=0;endProgress=0;pathRotate=!1;alignOffset=null;pathOffset=null;pathLUT=null;_isElement=!1;init(J,$,Q,Z,j="",q,z){return this.target=J,this.property=$,this.startValue=Q,this.endValue=Z,this.change=Z-Q,this.unit=j,this.startUnit=q??null,this.endUnit=z??null,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}initClipPath(J,$,Q,Z){return this.target=J,this.property=$,this.valueType="clipPath",this.startClipPath=Q,this.endClipPath=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,z,G,N,H={x:1,y:1}){if(J instanceof Element)y(J,!0);this.target=J,this.property=$,this.valueType="path",this.pathData=Q,this.motionPathLength=Z,this.startProgress=j,this.endProgress=q,this.pathRotate=z,this.alignOffset=G,this.pathOffset=N,this._isElement=J instanceof Element;let K=Math.abs(q-j),Y=Z*K,W=Math.min(_9,Math.max(X9,Math.ceil(Y*B9))),X=H?.x??1,_=H?.y??1,U=X!==1||_!==1;this.pathLUT=U9(W+1);for(let B=0;B<=W;B++){let O=B/W,F=j+(q-j)*O,A=rJ(Q,F,z);if(U)A.x*=X,A.y*=_;this.pathLUT[B]=A}if(z&&U&&X!==_){let B=this.pathLUT.length-1;for(let O=0;O<=B;O++){let F=this.pathLUT[Math.max(0,O-1)],A=this.pathLUT[Math.min(B,O+1)];this.pathLUT[O].angle=Math.atan2(A.y-F.y,A.x-F.x)*(180/Math.PI)}}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)r6(this.target,this.property,$,Q,Z,j)}else if(this.valueType==="filter"&&this.startFilters&&this.endFilters){if(this._isElement)t6(this.target,this.startFilters,this.endFilters,J)}else if(this.valueType==="clipPath"&&this.startClipPath&&this.endClipPath){if(this._isElement)e6(this.target,this.property,this.startClipPath,this.endClipPath,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(Q6||(Q6=I.drawSVG))Q6.applyDrawSVG(this.target,$,Q,this.pathLength)}}else if(this.valueType==="path"&&this.pathLUT&&this.pathLUT.length>0){if(this._isElement)J7(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)if(this.startUnit&&this.endUnit&&this.startUnit!==this.endUnit)a6(this.target,this.property,this.startValue,this.startUnit,this.endValue,this.endUnit,J);else n6(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.startUnit=null,this.endUnit=null,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.startClipPath=null,this.endClipPath=null,this.pathData=null,this.motionPathLength=0,this.startProgress=0,this.endProgress=0,this.pathRotate=!1,this.alignOffset=null,this.pathOffset=null,this.pathLUT)O9(this.pathLUT);this.pathLUT=null,this._isElement=!1}}class qJ{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 GJ=new qJ(()=>new Z6,500),A0={acquire:()=>GJ.acquire(),release:(J)=>GJ.release(J),getPoolSize:()=>GJ.getPoolSize(),getTotalCreated:()=>GJ.getTotalCreated(),clear:()=>GJ.clear()};var $7={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 u{static _createAnimationCallback=null;static setCreateAnimationCallback(J){u._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;_flapConfig;_onStart;_onUpdate;_onComplete;_onRepeat;_onReverseComplete;_skipInitialFromRender=!1;_plainObjectInitialValues=new Map;_expectedAnimationIds=[];_propsToAnimate=[];constructor(J,$){if(this._targets=YJ(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.flap){if(this._flapConfig=J.flap,!this._splitType)this._splitType="chars";else if(!this._splitType.includes("chars"))this._splitType="chars,"+this._splitType;if(this._stagger===void 0)this._stagger={each:0,from:"start"}}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)y(J),I.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(!I.fit){console.warn("[Motion] FitResolver not loaded. Did you import the SDK?");return}if(this._built=!0,!u._createAnimationCallback)throw Error("AnimationBuilder: Engine not initialized. Call Engine.init() first.");let G={};if(this._repeat!==void 0)G.repeat=this._repeat;if(this._repeatDelay!==void 0)G.repeatDelay=this._repeatDelay;if(this._yoyo)G.yoyo=this._yoyo;if(this._onStart)G.onStart=this._onStart;if(this._onUpdate)G.onUpdate=this._onUpdate;if(this._onComplete)G.onComplete=this._onComplete;if(this._onRepeat)G.onRepeat=this._onRepeat;if(this._onReverseComplete)G.onReverseComplete=this._onReverseComplete;if(this._stagger!==void 0)G.stagger=this._stagger;let N=[];for(let K of this._targets){if(!(K instanceof Element))continue;let Y=u._createAnimationCallback([K],{},this._duration,this._delay,this._ease,!1,void 0,G);if(Array.isArray(Y))N.push(...Y);else N.push(Y)}let H=this._fitConfig;for(let K of N)for(let Y of K.getTargets())if(Y instanceof Element)I.fit.registerPendingSetup(K,Y,H,A0);this._animation=N[0]??null,this._animations=N,this._expectedAnimationIds=N.map((K)=>K.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 G of Object.keys(Q))if(!(G in J))if(G in $7)J[G]=$7[G];else if($0(G))J[G]="";else if(c(G))J[G]="";else{let N=Q[G];if(N===void 0||N===null)continue;let K=S(N).unit||g(G),Y;for(let X of this._targets)if(X instanceof Element){if(p(G))try{let U=window.getComputedStyle(X).getPropertyValue(G).trim();if(U)Y=S(U).value}catch{}else Y=u0(X,G,K);break}let W=Y??0;J[G]=K?`${W}${K}`:`${W}`}}else if(this._fromVars)J={...this._fromVars},$=!0;else if(this._toVars)J={...this._toVars};if(this._splitType&&I.textSplitter?.split){let G={mask:!!this._mask,consumer:this},N=[];for(let H of this._originalTargets)if(H instanceof Element){let K=I.textSplitter?.split(H,this._splitType,G);N.push(...K)}if(N.length>0)this._targets=N}let Z,j;if(this._flapConfig&&I.textFlapper?.prepare&&u._createAnimationCallback){if(Q&&Object.keys(Q).length>0){let N=[];for(let H of Object.keys(Q)){let K=Q[H],Y=J[H];if(K===void 0||Y===void 0)continue;if($0(H)||c(H)||p(H))continue;if(H==="drawSVG"||H==="path"||H==="clip-path"||H==="clipPath")continue;let W=S(K),X=S(Y),_=W.unit||X.unit||g(H);N.push({prop:H,from:W.value,to:X.value,unit:_,isTransform:w(H)})}if(N.length>0)j=N}let G=this._targets.filter((N)=>N instanceof HTMLElement);if(G.length>0){let N=this._repeat!==void 0&&this._repeat!==0,H=I.textFlapper.prepare(G,this._flapConfig,N,j),K=this._stagger&&I.stagger?I.stagger.resolve(G,this._stagger):void 0;Z=[];let Y=0;for(let W=0;W<G.length;W++){let X=G[W].textContent??"";if(X===""||X===" "||X===" "||X===`
32
- `||X==="\t")continue;if(Y>=H.length)break;let U=H[Y],B=K?K[W]:0,O=u._createAnimationCallback([U.el],{},this._duration,B,this._ease??"power1.out",!1,void 0,{onUpdate:U.render,onComplete:U.finalize,repeat:N?Math.ceil(60/this._duration):0,_skipInitialRender:this._skipInitialFromRender||void 0}),F=Array.isArray(O)?O:[O];Z.push(...F),Y++}}}if(Z?.length&&this._flapConfig){let G=this._flapConfig.type??"flip",N=new Set(j?.map((W)=>W.prop)??[]),H=(W)=>{if(N.has(W))return!0;switch(G){case"fade":return W==="opacity";case"blur":return c(W);default:return!1}},K=[];for(let W of Object.keys(J))if(H(W))K.push(W),delete J[W];if(Q){for(let W of Object.keys(Q))if(H(W)&&!K.includes(W))K.push(W),delete Q[W]}let Y=K.filter((W)=>!N.has(W));if(Y.length>0)console.warn(`[Motion.page] Flap type '${G}' owns '${Y.join(", ")}' — user-defined values for these properties were removed. Use a different flap type to avoid this conflict.`)}if(this._propsToAnimate=Object.keys(J),Q){for(let G of Object.keys(Q))if(!this._propsToAnimate.includes(G))this._propsToAnimate.push(G)}if(this._plainObjectInitialValues.size===0)this._capturePlainObjectValues(this._propsToAnimate);if($){for(let G of this._targets)if(G instanceof Element)y(G),I.styleReset?.clearAnimationStylesForProps?.(G,this._propsToAnimate)}if(I.styleReset?.registerAnimatedProps){for(let G of this._targets)if(G instanceof Element)I.styleReset?.registerAnimatedProps(G,this._propsToAnimate)}let q={repeat:this._repeat,repeatDelay:this._repeatDelay,yoyo:this._yoyo,stagger:this._stagger,onStart:this._onStart,onUpdate:this._onUpdate,onComplete:this._onComplete,onRepeat:this._onRepeat,onReverseComplete:this._onReverseComplete,_skipInitialRender:this._skipInitialFromRender||void 0};if(!u._createAnimationCallback)throw Error("AnimationBuilder: Engine not initialized. Call AnimationBuilder.setCreateAnimationCallback first.");if(Object.keys(J).length>0||Q&&Object.keys(Q).length>0||!Z?.length){let G=u._createAnimationCallback(this._targets,J,this._duration,this._delay,this._ease,$,Q,q);if(Array.isArray(G))this._animations=G,this._animation=G[0]||null;else this._animation=G,this._animations=[G]}if(Z&&Z.length>0){if(this._animations.push(...Z),!this._animation)this._animation=Z[0]}if(this._expectedAnimationIds=this._animations.map((G)=>G.getId()),this._setVars&&Object.keys(this._setVars).length>0&&u._createAnimationCallback){let G=u._createAnimationCallback(this._targets,{...this._setVars},0,0,"none",!1,void 0,{_skipInitialRender:this._skipInitialFromRender||void 0}),N=Array.isArray(G)?G:[G];this._animations=[...N,...this._animations],this._expectedAnimationIds=this._animations.map((H)=>H.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}hasFlap(){return!!this._flapConfig}_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,flap:this._flapConfig?{...this._flapConfig}: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 FJ{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`),$}}var I9=0.000001;class P{static _eachCounter=0;static _registerWithEngine=null;static _activateEngine=null;static setEngineRegisterCallback(J){P._registerWithEngine=J}static setEngineActivationCallback(J){P._activateEngine=J}_name;_children=[];_initialRenderStartTimes=null;_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}_notifyActivated(){P._activateEngine?.()}_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&&P._registerWithEngine)P._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._initialRenderStartTimes=null,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 z=j;if(w(Z)||T0(Z)){if(this._transformElements.add(j),!this._initialTransforms.has(j)){let G=z.style.transform;this._initialTransforms.set(j,G||null)}q.set(Z,{removeInline:!0})}else if($0(Z)||c(Z))q.set(Z,{removeInline:!0});else if(B0(Z))q.set(Z,{removeInline:!0});else{let G=Z.replace(/([A-Z])/g,"-$1").toLowerCase();if(z.style.getPropertyValue(G)!==""){let H=sJ(j,Z);q.set(Z,{removeInline:!1,value:H.value,unit:H.unit})}else q.set(Z,{removeInline:!0})}}}Q=Q.next}}_restoreInitialValues(){for(let J of this._transformElements){let $=J;y(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(w(Z))continue;if(B0(Z)){Q.style.removeProperty("stroke-dasharray"),Q.style.removeProperty("stroke-dashoffset");continue}let q=Z.replace(/([A-Z])/g,"-$1").toLowerCase();if(j.removeInline)Q.style.removeProperty(q);else{let z=`${j.value}${j.unit}`;Q.style.setProperty(q,z)}}}}_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=FJ.parse(Q,this._duration,this._previousStart,this._previousEnd),j=new u(J,$);return this._addBuilder(j,Z)}_addBuilder(J,$){J.setSkipInitialFromRender(!0);let Q=J.getAnimations();if(Q.length===0)return this;this._initialRenderStartTimes=null;let Z=$;for(let j of Q){let q=j.getDelay(),z=$+q;j.clearDelay();let G=j.totalDuration(),N={type:"animation",child:j,builder:J,startTime:z,duration:G};this._children.push(N),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 H=!!J.getConfig().fromVars;if(z>0&&!H)j.setLazyStartCapture(!0);if(J.hasSplit()){for(let Y of J.getOriginalTargets())if(Y instanceof Element){let W=Y;if(!this._splitParentOverrides.has(W))this._splitParentOverrides.set(W,W.style.opacity);W.style.opacity="1"}}let K=z+G;if(K>Z)Z=K}if(this._previousStart=$,this._previousEnd=Z,Z>this._duration)this._duration=Z;if(!this._isActive&&this._time===0)this._renderInitialTimelineState();return this}_getInitialRenderStartTimes(){if(this._initialRenderStartTimes)return this._initialRenderStartTimes;let J=new Map;for(let $ of this._children){if($.type!=="animation")continue;let Q=$.child;if(Q.isLazyCapture())continue;let Z=Q.getFirstPropTween();while(Z){let j=Z.target;if(j){let q=J.get(j);if(!q)q=new Map,J.set(j,q);let z=q.get(Z.property);if(z===void 0||$.startTime<z)q.set(Z.property,$.startTime)}Z=Z.next}}return this._initialRenderStartTimes=J,J}_renderAnimationInitialBoundary(J,$){let Q=this._getInitialRenderStartTimes();$.renderAtTime(0,(Z)=>{let j=Z.target;if(!j)return!1;let z=Q.get(j)?.get(Z.property);return z!==void 0&&Math.abs(z-J.startTime)<I9})}_renderInitialTimelineState(){this._restoreInitialValues(),this._renderPositionZeroAnimations(),this._atZeroState=!0}call(J,$,Q){let Z=FJ.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(S0(j))return j}let $=this.getFirstChildAnimation();if($){let Q=$.getTargets();for(let Z of Q)if(S0(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(S0(q)&&!$.has(q))$.add(q),J.push(q)}return J}_createInstanceForElement(J,$){let Z=`${this._name||"__each"}__each_${$}_${P._eachCounter++}`,j=new P(Z),q=new Set;for(let z of this._children)if(z.type==="animation"&&z.builder){if(q.has(z.builder))continue;if(q.add(z.builder),!(z.builder.hasSplit()?z.builder.getOriginalTargets():z.builder.getTargets()).filter((W)=>S0(W)).includes(J))continue;let N=z.builder.getConfig(),H=N.repeat!=null?{times:N.repeat,delay:N.repeatDelay,yoyo:N.yoyo}:void 0,K=z.builder.hasSplit(),Y=new u(J,{from:N.fromVars,to:N.toVars,set:N.setVars,duration:N.duration,delay:N.delay,ease:N.ease,repeat:H,...K&&N.split?{split:N.split}:{},...K&&N.mask?{mask:N.mask}:{},...K&&N.stagger!==void 0?{stagger:N.stagger}:{},...N.flap?{flap:N.flap}:{},...N.fit?{fit:N.fit}:{},onStart:N.onStart,onUpdate:N.onUpdate,onComplete:N.onComplete,onRepeat:N.onRepeat,onReverseComplete:N.onReverseComplete});if(N.axis)Y.setAxis(N.axis);j._addBuilder(Y,z.startTime)}else if(z.type==="callback")j.call(z.child,z.params,z.startTime);return j}_createInstanceForElements(J,$){let Z=`${this._name||"__each"}__each_${$}_${P._eachCounter++}`,j=new P(Z),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 G=z.builder.getConfig(),N=(z.builder.hasSplit()?z.builder.getOriginalTargets():z.builder.getTargets()).filter((X)=>S0(X)),H=J.filter((X)=>N.includes(X));if(H.length===0)continue;let K=G.repeat!=null?{times:G.repeat,delay:G.repeatDelay,yoyo:G.yoyo}:void 0,Y=z.builder.hasSplit(),W=new u(H,{from:G.fromVars,to:G.toVars,set:G.setVars,duration:G.duration,delay:G.delay,ease:G.ease,repeat:K,...Y&&G.split?{split:G.split}:{},...Y&&G.mask?{mask:G.mask}:{},...(Y||H.length>1)&&G.stagger!==void 0?{stagger:G.stagger}:{},...G.flap?{flap:G.flap}:{},...G.fit?{fit:G.fit}:{},onStart:G.onStart,onUpdate:G.onUpdate,onComplete:G.onComplete,onRepeat:G.onRepeat,onReverseComplete:G.onReverseComplete});if(G.axis)W.setAxis(G.axis);j._addBuilder(W,z.startTime)}else if(z.type==="callback")j.call(z.child,z.params,z.startTime);return j}_findScopedTargetsForContainer(J,$,Q){let Z=$.filter((q)=>J.contains(q));if(Z.length>0)return Z;let j=J.parentElement;if(j){let q=$.filter((z)=>z!==J&&j.contains(z)&&!Q.some((G)=>G!==J&&G.contains(z)));if(q.length>0)return q}return[]}_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=new Set(this._children.filter((Z)=>Z.type==="animation"&&Z.builder?.hasSplit()).map((Z)=>Z.builder));if(Q.size>0)for(let Z of J)for(let j of Q)I.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,z=this._onComplete;for(let G of this._eachInstances){if(j)G.onUpdate((N,H)=>{let K=N>0&&N<1;if(K)Z=G;if(Z===G){if(j(N,H),!K)Z=null}});if(q)G.onStart(()=>{Z=G,q()});if(z)G.onComplete(()=>{if(Z===G)Z=null,z()})}}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=I.triggerManager?.getInstance?.();if(!Q)return;let{each:Z,...j}=$;if($.target){let z=this._resolveTargetElements($.target);if(z.length===0)return;let G=this._getAllAnimationTargets(),N=new Set;for(let Y of z){let W=G.filter((_)=>Y.contains(_));if(W.length>0){for(let _ of W)N.add(_);continue}let X=Y.parentElement;if(X){let _=G.filter((U)=>U!==Y&&X.contains(U)&&!z.some((B)=>B!==Y&&B.contains(U)));for(let U of _)N.add(U)}}if(!G.every((Y)=>N.has(Y))&&J==="scroll"){let Y=new Set(this._children.filter((W)=>W.type==="animation"&&W.builder?.hasSplit()).map((W)=>W.builder));if(Y.size>0)for(let W of G)for(let X of Y)I.textSplitter?.revert?.(W,X);this._setupEachModeGeneric(G,(W,X)=>{if(J==="scroll")Q.registerScroll(W,{...j,target:X});else if(J==="hover")Q.registerHover(W,{...j,target:X});else Q.registerClick(W,{...j,target:X})});return}let K=new Set(this._children.filter((Y)=>Y.type==="animation"&&Y.builder?.hasSplit()).map((Y)=>Y.builder));if(K.size>0)for(let Y of G)for(let W of K)I.textSplitter?.revert?.(Y,W);this._clearTransitionData(),this._eachInstances=[];for(let Y=0;Y<z.length;Y++){let W=z[Y],X=this._findScopedTargetsForContainer(W,G,z);if(X.length===0)continue;let _=this._createInstanceForElements(X,Y);if(J==="scroll")Q.registerScroll(_,{...j,target:W});else if(J==="hover")Q.registerHover(_,{...j,target:W});else Q.registerClick(_,{...j,target:W});this._eachInstances.push(_)}{let Y=null,W=this._onUpdate,X=this._onStart,_=this._onComplete;for(let U of this._eachInstances){if(W)U.onUpdate((B,O)=>{let F=B>0&&B<1;if(F)Y=U;if(Y===U){if(W(B,O),!F)Y=null}});if(X)U.onStart(()=>{Y=U,X()});if(_)U.onComplete(()=>{if(Y===U)Y=null,_()})}}this._eachDuration=this._duration;for(let Y of this._children)if(Y.type==="animation"){let W=Y.child;W.setTimelineChild(!1),W.kill()}else if(Y.type==="timeline")Y.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,(z,G)=>{if(J==="scroll")Q.registerScroll(z,{...j,target:G});else if(J==="hover")Q.registerHover(z,{...j,target:G});else Q.registerClick(z,{...j,target:G})})}onHover(J){if(J?.each)return this._setupEachMode("hover",J),this;let $=J?.target??this._getFirstAnimationTarget();return I.triggerManager?.getInstance?.().registerHover(this,{target:$,onEnter:J?.onEnter,onLeave:J?.onLeave,leaveDelay:J?.leaveDelay}),this}onClick(J){if(J?.each)return this._setupEachMode("click",J),this;let $=J?.target??this._getFirstAnimationTarget();return I.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 I.triggerManager?.getInstance?.().registerScroll(this,{...J,target:$}),this}onMouseMove(J){if(J?.each&&J.target)return this._setupMouseMoveEachMode(J),this;return I.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=I.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 I.triggerManager?.getInstance?.().registerPageLoad(this,J||{}),this}onPageExit(J){return I.triggerManager?.getInstance?.().registerPageExit(this,J||{}),this}onGesture(J){if(J.each)return this._setupGestureEachMode(J),this;return I.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=I.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 I.triggerManager?.getInstance?.().registerCursor(this,J),this}_updateCallbackChild(J,$,Q){let Z=J.startTime,j=$<Z&&this._time>=Z,q=$>Z&&this._time<=Z,z=Math.abs(this._time-Z)<0.001;if(j||q||z&&Q===0){let G=J.child,N=J.params||[];G(...N)}}_updateAnimationChild(J,$){let Q=J.child,Z=Math.abs(Q.getTimeScale())||1,j=Q.totalDuration()/Z,q=this._time-J.startTime,z=q*Z;if(q>=0&&q<=j){if(!Q.isActive())Q.captureStartValues(),Q.play();Q.renderAtTime(z)}else if(q<0){if(!Q.isLazyCapture())this._renderAnimationInitialBoundary(J,Q);if(Q.isActive())Q.pause(),Q.fireReverseComplete()}else if(Q.isActive())Q.renderAtTime(Q.totalDuration()),Q.pause();else if($===0){if(Q.needsStartCapture())Q.captureStartValues();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{let j=this._time-this._duration;this._time=Math.max(0,j),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._notifyActivated(),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._notifyActivated(),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._notifyActivated(),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())this._renderAnimationInitialBoundary(J,$);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}if(this._time=Math.max(0,Math.min(J,this._duration)),this._progress=this._duration>0?this._time/this._duration:0,this._atZeroState=!1,this._repeat!==0){for(let $ of this._children)if($.type==="animation")$.child.resetForReplay()}return 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,z=q.totalDuration();if(!q.isActive())q.captureStartValues(),q.play();q.renderAtTime(Q*z)}}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._atZeroState=this._time===0?this._atZeroState:!1,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,I.triggerManager?.getInstance?.().unregister(this),this._eachInstances){for(let Q of this._eachInstances)Q.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,Z]of this._splitParentOverrides)if(Z)Q.style.opacity=Z;else Q.style.removeProperty("opacity");this._splitParentOverrides.clear()}let $=new Set(this._children.filter((Q)=>Q.type==="animation"&&Q.builder?.hasSplit()).map((Q)=>Q.builder));if($.size>0){for(let Q of $)for(let Z of Q.getOriginalTargets())if(Z instanceof Element)I.textSplitter?.revert?.(Z,Q)}for(let Q of this._children)if(Q.type==="animation"){let Z=Q.child;Z.setTimelineChild(!1),Z.kill()}else if(Q.type==="timeline")Q.child.kill(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 AJ(J,$,Q){let Z=J;if(w($)){let z=Q??($.startsWith("scale")?"":"px");return(G)=>{E(J,$,G,z),Z.style.transform=C(J)}}if($.startsWith("--")){let z=Q??"";return(G)=>{Z.style.setProperty($,`${G}${z}`)}}let j=$.replace(/([A-Z])/g,"-$1").toLowerCase(),q=Q??"";return(z)=>{Z.style.setProperty(j,`${z}${q}`)}}var F9=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 A9(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 m0 extends l{_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;_pointerMoveTarget=null;_hoverSelectors=null;_isHoveringCursorTarget=!1;_boundHoverTargetMoveHandler=null;_hoverPointerMoveTarget=null;_boundTextAttributeMoveHandler=null;_textPointerMoveTarget=null;_activeTextAttributeElement=null;_hasTextAttributeElements=!1;_textAttributeObserver=null;_textAttributeObserverActive=!1;_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),E(this._innerElement,"x",-50,"%"),E(this._innerElement,"y",-50,"%"),this._xSetter=AJ(this._element,"x","px"),this._ySetter=AJ(this._element,"y","px"),this._config.squeeze)this._squeezeSetter=AJ(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=C(this._innerElement),this._config.hideNative)this._cursorStyleTag=document.createElement("style"),this._cursorStyleTag.setAttribute("data-cursor-hide",""),this._cursorStyleTag.textContent="html { cursor: none; }",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),T.getInstance().add(this._tickerCallback)}_onDisable(){if(this._tickerCallback)T.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=m0._expandTransformShorthand(String(Q));for(let[j,q]of Object.entries(Z))E(this._innerElement,j,q)}else if(w($)){let Z=typeof Q==="number"?{value:Q,unit:g($)}:S(Q);E(this._innerElement,$,Z.value,Z.unit||g($)||void 0)}else{let Z=h($),j=typeof Q==="number"&&!F9.has(Z)?`${Q}px`:String(Q);(Z==="mix-blend-mode"&&this._element?this._element:this._innerElement).style.setProperty(Z,j)}}_createStateTimelines(){if(!this._innerElement)return;let J=this._parsedStates.get("hover");if(J&&J.enabled){let Q=new P;Q._addEntry(this._innerElement,{to:m0._expandStateProperties(J.properties),duration:J.duration,ease:J.ease}),this._stateTimelines.set("hover",Q)}let $=this._parsedStates.get("click");if($&&$.enabled){let Q=new P;Q._addEntry(this._innerElement,{to:m0._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=m0._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((z)=>parseFloat(z.trim()));switch(j){case"scale":{let z=q[0]??1,G=q.length>1?q[1]:z;if(z===G)$.scale=z;else $.scaleX=z,$.scaleY=G;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},this._pointerMoveTarget=typeof document<"u"?document:typeof window<"u"?window:null,J0(this._boundMouseMove,this._pointerMoveTarget),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)this._isHoveringCursorTarget=!1,this._releaseHoverIfInactive()},this._hoverPointerMoveTarget=typeof window<"u"?window:null,J0(this._boundHoverTargetMoveHandler,this._hoverPointerMoveTarget)}_setupTextCursor(){if(!this._innerElement)return;this._innerElement.style.display="grid",this._innerElement.style.placeItems="center",this._innerElement.style.overflow="visible",this._textElement=document.createElement("div"),this._textElement.setAttribute("data-cursor-text",""),this._textElement.style.whiteSpace="nowrap",this._textElement.style.opacity="0",this._innerElement.appendChild(this._textElement);let $=this._parsedStates.get("hover")?.duration??0.15;if(this._textElement.style.transition=`opacity ${$}s ease-in-out`,this._config.text)for(let[Q,Z]of Object.entries(this._config.text))this._textElement.style.setProperty(h(Q),String(Z));this._setupTextAttributeHitTesting()}_setupTextAttributeHitTesting(){this._updateHasTextAttributeElements(),this._observeTextAttributeElements(),this._boundTextAttributeMoveHandler=(J)=>{if(this._textAttributeObserverActive&&!this._hasTextAttributeElements){if(this._activeTextAttributeElement)this._activeTextAttributeElement=null,this._hideTextCursor();return}let $=this._findTextAttributeTarget(J);if($){this._activeTextAttributeElement=$,this._showTextCursor($);return}if(this._activeTextAttributeElement)this._activeTextAttributeElement=null,this._hideTextCursor()},this._textPointerMoveTarget=typeof document<"u"?document:typeof window<"u"?window:null,J0(this._boundTextAttributeMoveHandler,this._textPointerMoveTarget)}_updateHasTextAttributeElements(){if(typeof document>"u"||typeof document.querySelector!=="function"){this._hasTextAttributeElements=!1;return}try{this._hasTextAttributeElements=document.querySelector("[mp-cursor-text], [mp-cursor-tooltip]")!==null}catch{this._hasTextAttributeElements=!1}}_observeTextAttributeElements(){if(typeof document>"u"||typeof MutationObserver!=="function")return;let J=document.body??document.documentElement;if(!J)return;try{let $=new MutationObserver(()=>{this._updateHasTextAttributeElements()});$.observe(J,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["mp-cursor-text","mp-cursor-tooltip"]}),this._textAttributeObserver=$,this._textAttributeObserverActive=!0}catch{this._textAttributeObserver=null,this._textAttributeObserverActive=!1}}_findTextAttributeTarget(J){let Q=(Z)=>{let j=Z;if(!j||typeof j.getAttribute!=="function")return null;if(j.getAttribute("mp-cursor-text")!==null||j.getAttribute("mp-cursor-tooltip")!==null)return j;if(typeof j.closest==="function")try{return j.closest("[mp-cursor-text], [mp-cursor-tooltip]")}catch{return null}return null};if(typeof document<"u"&&typeof document.elementsFromPoint==="function")for(let Z of document.elementsFromPoint(J.clientX,J.clientY)){let j=Q(Z);if(j)return j}return Q(J.target)}_showTextCursor(J){let $=J.getAttribute("mp-cursor-text")??J.getAttribute("mp-cursor-tooltip")??"";if(this._textElement)this._textElement.textContent=$,this._textElement.style.opacity="1";this._setState("hover")}_releaseHoverIfInactive(){if(this._isHoveringCursorTarget)return;if(this._activeTextAttributeElement)return;if(this._state==="hover")this._setState("default")}_hideTextCursor(){if(this._textElement)this._textElement.style.opacity="0";this._releaseHoverIfInactive()}_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(h(Z),String(j)),$.style.setProperty(h(Z),String(j));let Q=document.querySelectorAll("[mp-cursor-media]");for(let Z of Q){let j=(z)=>{let G=z.target.getAttribute("mp-cursor-media")||"";if(!G||!A9(G)){if(G)console.warn(`[Motion] Blocked unsafe media URL: "${G}". Only http/https URLs and relative paths are allowed.`);return}if(G.endsWith(".mp4")||G.endsWith(".webm"))$.src=G,$.style.display="block",J.style.display="none",$.play().catch(()=>{}),this._mediaElement=$;else J.src=G,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)j0(this._boundMouseMove,this._pointerMoveTarget),this._boundMouseMove=void 0,this._pointerMoveTarget=null;if(this._boundMouseDown)document.removeEventListener("mousedown",this._boundMouseDown);if(this._boundMouseUp)document.removeEventListener("mouseup",this._boundMouseUp);if(this._boundHoverTargetMoveHandler)j0(this._boundHoverTargetMoveHandler,this._hoverPointerMoveTarget),this._boundHoverTargetMoveHandler=null,this._hoverPointerMoveTarget=null;if(this._hoverSelectors=null,this._isHoveringCursorTarget=!1,this._boundTextAttributeMoveHandler)j0(this._boundTextAttributeMoveHandler,this._textPointerMoveTarget),this._boundTextAttributeMoveHandler=null,this._textPointerMoveTarget=null;if(this._textAttributeObserver)this._textAttributeObserver.disconnect(),this._textAttributeObserver=null;this._textAttributeObserverActive=!1,this._hasTextAttributeElements=!1,this._activeTextAttributeElement=null,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,z=1-(Math.exp(Q/q)-1)/10;if(Number.isNaN(z))return 1;return Math.max(Z,Math.min(j,z))}getElement(){return this._element}getState(){return this._state}}D.registerTrigger("cursor",m0);class Q7 extends l{_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 z=J.href;if(!z)return;Z.preventDefault(),Z.stopPropagation(),this._isNavigating=!0,this._pendingUrl=z,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}}D.registerTrigger("pageExit",Q7);var j6=null;function L9(){if(!j6&&typeof document<"u"){let J=document.createElement("canvas");J.width=1,J.height=1,j6=J.getContext("2d")}return j6}function Z7(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 M9(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 D9(J,$,Q){J=J/360,$=$/100,Q=Q/100;let Z,j,q;if($===0)Z=j=q=Q;else{let z=(H,K,Y)=>{if(Y<0)Y+=1;if(Y>1)Y-=1;if(Y<0.16666666666666666)return H+(K-H)*6*Y;if(Y<0.5)return K;if(Y<0.6666666666666666)return H+(K-H)*(0.6666666666666666-Y)*6;return H},G=Q<0.5?Q*(1+$):Q+$-Q*$,N=2*Q-G;Z=z(N,G,J+0.3333333333333333),j=z(N,G,J),q=z(N,G,J-0.3333333333333333)}return[Math.round(Z*255),Math.round(j*255),Math.round(q*255)]}function R9(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[z,G,N]=D9(Q,Z,j);return new Float32Array([z,G,N,q])}function k9(J,$){if(!$||typeof window>"u")return null;let Q=J.trim(),j=(/^--[\w-]+$/.test(Q)?`var(${Q})`:Q).match(/var\s*\(\s*(--[\w-]+)\s*(?:,\s*(.+))?\s*\)\s*$/i);if(!j)return null;let q=j[1],z=window.getComputedStyle($).getPropertyValue(q).trim();if(z)return LJ(z,$);let G=j[2]?.trim();if(G)return LJ(G,$);return null}function b9(J){let $=L9();if(!$)return null;$.fillStyle="#000000",$.fillStyle=J;let Q=$.fillStyle;if(Q==="#000000"&&J.toLowerCase()!=="black"&&J!=="#000000"&&J!=="#000")return null;return Z7(Q)}function LJ(J,$){if(!J||typeof J!=="string")return null;let Q=J.trim(),Z=Q.toLowerCase();if(Z==="transparent")return new Float32Array([0,0,0,0]);if(Q.startsWith("#"))return Z7(Q);if(Z.startsWith("rgb"))return M9(Q);if(Z.startsWith("hsl"))return R9(Q);if(/^var\s*\(/i.test(Q)||/^--[\w-]+$/.test(Q))return k9(Q,$);return b9(Z)}function E9(J,$){if(typeof window>"u")return new Float32Array([0,0,0,1]);let Q=window.getComputedStyle(J),Z=$.replace(/[A-Z]/g,(z)=>`-${z.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 LJ(j,J)||new Float32Array([0,0,0,1])}I.color={parseColor:LJ,getCurrentColor:E9};var j7={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 V9(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 q7(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=V9(j[0]);if(q)Q.push(q)}return Q.length>0?Q:null}function w9(J){let $=j7[J.name];if(!$)return!1;return J.value===$.value}function x9(J){if(!J||J.length===0)return"none";if(J.every(w9))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 C9(J){if(typeof window>"u")return[];let $=window.getComputedStyle(J),Q=$.filter||$.getPropertyValue("filter");if(!Q||Q==="none")return[];return q7(Q)||[]}function S9(J){let $=j7[J];if($)return{name:J,value:$.value,unit:$.unit};return{name:J,value:0,unit:""}}function P9(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 z=J.find((H)=>H.name===q),G=$.find((H)=>H.name===q),N=S9(q);Z.push(z||N),j.push(G||N)}return{start:Z,end:j}}var c0=[];function y9(J,$,Q){let Z=J.length;if(c0.length<Z)for(let j=c0.length;j<Z;j++)c0.push({name:"",value:0,unit:""});for(let j=0;j<Z;j++){let q=J[j],z=$[j],G=c0[j];G.name=q.name,G.value=q.value+(z.value-q.value)*Q,G.unit=q.unit||z.unit}return c0.length=Z,c0}I.filter={parseFilter:q7,getCurrentFilter:C9,mergeFilterArrays:P9,interpolateFilters:y9,filterToString:x9};var G7=new WeakMap;function v9(J){return"getTotalLength"in J&&typeof J.getTotalLength==="function"}function MJ(J){let $=G7.get(J);if($!==void 0)return $;if(v9(J)){let Q=J.getTotalLength();return G7.set(J,Q),Q}return 0}function T9(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]),z=Z[2]||"%",G=parseFloat(Z[3]),N=Z[4]||"%",H=$?MJ($):0,K=q6(q,z,H),Y=q6(G,N,H);return{start:K,end:Y}}let j=Q.match(/^([-\d.]+)(px|%)?$/);if(j){let q=parseFloat(j[1]),z=j[2]||"%",G=$?MJ($):0;return{start:0,end:q6(q,z,G)}}}return null}function q6(J,$,Q){if($==="px"&&Q>0)return J/Q;return J/100}function h9(J){let $=MJ(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((G)=>!isNaN(G)),z=parseFloat(j)||0;if(q.length>=1){let G=q[0],N=-z/$,H=(-z+G)/$;return{start:N,end:H}}}}catch{}return{start:0,end:1}}function f9(J,$,Q,Z){if(!(J instanceof SVGElement)||Z===0)return;let j=J,q=Math.abs(Q-$)*Z,z=Math.min($,Q)*Z;j.style.strokeDasharray=`${q} ${Z}`,j.style.strokeDashoffset=`${-z}`}I.drawSVG={parseDrawSVG:T9,getCurrentDrawSVG:h9,getPathLength:MJ,applyDrawSVG:f9};var z7=/(-?\d*\.?\d+)([a-z%]*)/gi;function N7(J){z7.lastIndex=0;let $=z7.exec(J);if(!$)return null;let Q=parseFloat($[1]);if(!isFinite(Q))return null;return{value:Q,unit:$[2]||""}}function L0(J){let $=[],Q=/(-?\d*\.?\d+)([a-z%]*)/gi,Z;while((Z=Q.exec(J))!==null){let j=parseFloat(Z[1]);if(!isFinite(j))continue;$.push({value:j,unit:Z[2]||""})}return $}function H7(J){if(J===null||J===void 0||typeof J!=="string")return null;let $=J.trim();if($===""||$==="none")return null;let Q=$.match(/^([a-z-]+)\s*\(\s*([\s\S]*)\s*\)\s*$/i);if(!Q)return null;let Z=Q[1].toLowerCase(),j=Q[2];switch(Z){case"circle":return u9(j);case"ellipse":return d9(j);case"inset":return m9(j);case"polygon":return c9(j);case"rect":return p9(j);case"xywh":return g9(j);default:return null}}function u9(J){let[$,Q]=Y7(J),Z=N7($)??{value:50,unit:"%"},[j,q]=K7(Q);return{shape:"circle",components:[Z,j,q]}}function d9(J){let[$,Q]=Y7(J),Z=L0($),j=Z[0]??{value:50,unit:"%"},q=Z[1]??j,[z,G]=K7(Q);return{shape:"ellipse",components:[j,q,z,G]}}function m9(J){let{mainPart:$,roundPart:Q}=G6(J),Z=L0($),j=Z[0]??{value:0,unit:"px"},q=Z[1]??j,z=Z[2]??j,G=Z[3]??q,N=[j,q,z,G];if(Q!==null){let H=L0(Q);if(H.length===0)N.push({value:0,unit:"px"});else for(let K of H)N.push(K)}return{shape:"inset",components:N,extras:Q!==null?{hasRound:!0}:void 0}}function c9(J){let $=[],Z=J.replace(/^(nonzero|evenodd)\s*,\s*/i,"").split(",");for(let j of Z){let q=L0(j);if(q.length>=2)$.push(q[0],q[1])}return{shape:"polygon",components:$}}function p9(J){let{mainPart:$,roundPart:Q}=G6(J),Z=L0($),j=Z[0]??{value:0,unit:"px"},q=Z[1]??j,z=Z[2]??j,G=Z[3]??q,N=[j,q,z,G];if(Q!==null){let H=L0(Q);if(H.length===0)N.push({value:0,unit:"px"});else for(let K of H)N.push(K)}return{shape:"rect",components:N,extras:Q!==null?{hasRound:!0}:void 0}}function g9(J){let{mainPart:$,roundPart:Q}=G6(J),Z=L0($),j=Z[0]??{value:0,unit:"px"},q=Z[1]??{value:0,unit:"px"},z=Z[2]??{value:0,unit:"px"},G=Z[3]??{value:0,unit:"px"},N=[j,q,z,G];if(Q!==null){let H=L0(Q);if(H.length===0)N.push({value:0,unit:"px"});else for(let K of H)N.push(K)}return{shape:"xywh",components:N,extras:Q!==null?{hasRound:!0}:void 0}}function Y7(J){let $=J.toLowerCase().search(/\bat\b/);if($===-1)return[J.trim(),""];return[J.slice(0,$).trim(),J.slice($+2).trim()]}function G6(J){let $=J.toLowerCase().search(/\bround\b/);if($===-1)return{mainPart:J.trim(),roundPart:null};return{mainPart:J.slice(0,$).trim(),roundPart:J.slice($+5).trim()}}function K7(J){let $=[{value:50,unit:"%"},{value:50,unit:"%"}];if(!J)return $;let Q=J.trim().split(/\s+/),Z=[];for(let z of Q){let G=N7(z);if(G){Z.push(G);continue}let N=z.toLowerCase();if(N==="center")Z.push({value:50,unit:"%"});else if(N==="left"||N==="top")Z.push({value:0,unit:"%"});else if(N==="right"||N==="bottom")Z.push({value:100,unit:"%"})}let j=Z[0]??$[0],q=Z[1]??$[1];return[j,q]}function o9(J){if(typeof window>"u")return null;try{let $=window.getComputedStyle(J),Q=$.clipPath||$.getPropertyValue("clip-path")||$.getPropertyValue("-webkit-clip-path");if(!Q||Q==="none")return null;return H7(Q)}catch{return null}}function X7(J,$){if(J.shape!==$.shape)return!1;if(J.components.length!==$.components.length)return!1;return!0}var p0=[];function l9(J,$,Q){if(!X7(J,$))return Q>=0.5?$:J;let Z=J.components.length;if(p0.length<Z)for(let j=p0.length;j<Z;j++)p0.push({value:0,unit:""});p0.length=Z;for(let j=0;j<Z;j++){let q=J.components[j],z=$.components[j],G=p0[j];G.value=q.value+(z.value-q.value)*Q,G.unit=z.unit||q.unit}return{shape:$.shape,components:p0,extras:$.extras??J.extras}}function b(J){return`${Math.round(J.value*1e4)/1e4}${J.unit}`}function s9(J){let $=J.components;switch(J.shape){case"circle":return`circle(${b($[0])} at ${b($[1])} ${b($[2])})`;case"ellipse":return`ellipse(${b($[0])} ${b($[1])} at ${b($[2])} ${b($[3])})`;case"inset":{let Q=`${b($[0])} ${b($[1])} ${b($[2])} ${b($[3])}`;if(J.extras?.hasRound&&$.length>4){let Z=$.slice(4).map(b).join(" ");return`inset(${Q} round ${Z})`}return`inset(${Q})`}case"polygon":{let Q=[];for(let Z=0;Z<$.length;Z+=2)Q.push(`${b($[Z])} ${b($[Z+1])}`);return`polygon(${Q.join(", ")})`}case"rect":{let Q=`${b($[0])} ${b($[1])} ${b($[2])} ${b($[3])}`;if(J.extras?.hasRound&&$.length>4){let Z=$.slice(4).map(b).join(" ");return`rect(${Q} round ${Z})`}return`rect(${Q})`}case"xywh":{let Q=`${b($[0])} ${b($[1])} ${b($[2])} ${b($[3])}`;if(J.extras?.hasRound&&$.length>4){let Z=$.slice(4).map(b).join(" ");return`xywh(${Q} round ${Z})`}return`xywh(${Q})`}}}I.clipPath={parseClipPath:H7,getCurrentClipPath:o9,interpolateClipPaths:l9,clipPathToString:s9,canInterpolate:X7};var x0=new WeakMap;function B7(J,$,Q,Z){let q=(J.getAttribute("data-split")??"").split(",").map((X)=>X.trim()),z=Q.split(",").map((X)=>X.trim()),G=z.includes("chars"),N=z.includes("words"),H=z.includes("lines"),K=q.includes("chars"),Y=q.includes("words"),W=q.includes("lines");if((!G||K)&&(!N||Y)&&(!H||W))return z6($.result,Q);if(H||W)return null;if(Y&&!K&&G){let X=[];for(let U of $.result.words)i9(U,X);$.result.chars=X,$.result.elements=X;let _=_7(q,z);if(J.setAttribute("data-split",_),Z?.mask)N6($.result);return H6(J,$.result),G?X:$.result.words.slice()}if(K&&!Y&&N){let X=Array.from(J.querySelectorAll("[data-split-word-wrap]")),_=[];for(let B=0;B<X.length;B++){let O=X[B];O.removeAttribute("data-split-word-wrap"),O.setAttribute("data-split-word",""),O.setAttribute("data-word-index",String(B)),_.push(O)}$.result.words=_;let U=_7(q,z);return J.setAttribute("data-split",U),G?$.result.chars.slice():_}return null}function z6(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()}function _7(J,$){let Q=new Set([...J,...$]);return["lines","words","chars"].filter((Z)=>Q.has(Z)).join(",")}function i9(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 z=q.textContent??"";if(!z)continue;let G=document.createDocumentFragment();for(let N of z)if(/\s/.test(N))G.appendChild(document.createTextNode(N));else{let H=document.createElement("span");H.setAttribute("data-split-char",""),H.setAttribute("data-char-index",String($.length)),H.style.display="inline-block",H.textContent=N,$.push(H),G.appendChild(H)}q.parentNode?.replaceChild(G,q)}}function N6(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)}}function H6(J,$){let Q=window.getComputedStyle(J);if((Q.getPropertyValue("background-clip")||Q.getPropertyValue("-webkit-background-clip"))!=="text")return;let j=Q.getPropertyValue("background-image"),q=J.querySelectorAll("[data-split-mask], [data-split-word], [data-split-word-wrap], [data-split-char], [data-split-line]");for(let z of q)z.style.backgroundImage=j,z.style.backgroundClip="text",z.style.setProperty("-webkit-background-clip","text"),z.style.setProperty("-webkit-text-fill-color","transparent")}function RJ(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+)/),z=document.createDocumentFragment(),G=!1;for(let N of q)if(/^\s+$/.test(N))z.appendChild(document.createTextNode(N.replace(/\n/g," "))),G=!0;else if(N){let H=document.createElement("span");H.setAttribute("data-split-word",""),H.setAttribute("data-word-index",String($.words.length)),H.style.display="inline-block",H.textContent=N,$.words.push(H),z.appendChild(H),G=!0}if(G)J.replaceChild(z,Z)}else if(Z.nodeType===1){let j=Z;if(j.tagName==="BR")continue;RJ(j,$)}}function Y6(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+)/),z=document.createDocumentFragment();for(let G of q)if(/^\s+$/.test(G))z.appendChild(document.createTextNode(G.replace(/\n/g," ")));else if(G){let N=document.createElement("span");N.setAttribute("data-split-word-wrap",""),N.style.display="inline-block",N.style.whiteSpace="nowrap";for(let H of G){let K=document.createElement("span");K.setAttribute("data-split-char",""),K.setAttribute("data-char-index",String($.chars.length)),K.style.display="inline-block",K.textContent=H,$.chars.push(K),N.appendChild(K)}z.appendChild(N)}J.replaceChild(z,Z)}else if(Z.nodeType===1){let j=Z;if(j.tagName==="BR")continue;Y6(j,$)}}function K6(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+)/),z=document.createDocumentFragment();for(let G of q)if(/^\s+$/.test(G))z.appendChild(document.createTextNode(G.replace(/\n/g," ")));else if(G){let N=document.createElement("span");N.setAttribute("data-split-word",""),N.setAttribute("data-word-index",String($.words.length)),N.style.display="inline-block",N.style.whiteSpace="nowrap";for(let H of G){let K=document.createElement("span");K.setAttribute("data-split-char",""),K.setAttribute("data-char-index",String($.chars.length)),K.style.display="inline-block",K.textContent=H,$.chars.push(K),N.appendChild(K)}$.words.push(N),z.appendChild(N)}J.replaceChild(z,Z)}else if(Z.nodeType===1){let j=Z;if(j.tagName==="BR")continue;K6(j,$)}}function W7(J,$,Q,Z){let j={chars:[],words:[],lines:[],elements:[]};RJ(J,j);let q=[],z=[],G=-1/0;for(let X of j.words){let _=X.getBoundingClientRect();if(_.top>G+2){if(z.length>0)q.push(z);z=[X],G=_.top}else z.push(X)}if(z.length>0)q.push(z);let N=new Map;for(let X of j.words)N.set(X,n9(X,J));let H="",K=0,Y=0,W=0;for(let X of q){let _="",U=[];for(let B=0;B<X.length;B++){let O=X[B],F=O.textContent||"",A=N.get(O)||[],L=0;while(L<U.length&&L<A.length&&U[L]===A[L])L++;for(let k=U.length-1;k>=L;k--)_+=`</${U[k].tagName.toLowerCase()}>`;if(B>0)_+=" ";for(let k=L;k<A.length;k++)_+=a9(A[k]);if(Q){let k="";for(let K0 of F)k+=`<span data-split-char data-char-index="${W}" style="display:inline-block">${DJ(K0)}</span>`,W++;if($)_+=`<span data-split-word data-word-index="${Y}" style="display:inline-block;white-space:nowrap">${k}</span>`;else _+=k}else if($)_+=`<span data-split-word data-word-index="${Y}" style="display:inline-block">${DJ(F)}</span>`;else _+=DJ(F);Y++,U=A}for(let B=U.length-1;B>=0;B--)_+=`</${U[B].tagName.toLowerCase()}>`;H+=`<span data-split-line data-line-index="${K}" style="display:block">${_}</span>`,K++}if(J.innerHTML=H,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]"))}function n9(J,$){let Q=[],Z=J.parentElement;while(Z&&Z!==$)Q.unshift(Z),Z=Z.parentElement;return Q}function a9(J){let $=J.tagName.toLowerCase(),Q="";for(let Z of Array.from(J.attributes))Q+=` ${Z.name}="${DJ(Z.value)}"`;return`<${$}${Q}>`}function DJ(J){return J.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}class zJ{static split(J,$,Q){if(!(J instanceof HTMLElement))return[];let Z=Q?.consumer,j=x0.get(J);if(j){if(Z&&j.consumers.has(Z)){if((J.getAttribute("data-split")??"")===$)return z6(j.result,$);j.consumers.delete(Z)}if(Z)j.consumers.add(Z);if(j.consumers.size>1){let Y=B7(J,j,$,Q);if(Y!==null)return Y;let W=$.split(",").map((X)=>X.trim());if(W.includes("chars")&&j.result.chars.length>0)return j.result.chars.slice();if(W.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"),x0.delete(J)}let q=J.innerHTML,z={chars:[],words:[],lines:[],elements:[]},G=$.split(",").map((Y)=>Y.trim()),N=G.includes("chars"),H=G.includes("words"),K=G.includes("lines");if(K)W7(J,H,N,z);else if(H&&N)K6(J,z);else if(H)RJ(J,z);else if(N)Y6(J,z);if(N)z.elements=z.chars;else if(H)z.elements=z.words;else if(K)z.elements=z.lines;if(Q?.mask&&z.elements.length>0)N6(z);return H6(J,z),x0.set(J,{originalHTML:q,result:z,consumers:new Set(Z?[Z]:[])}),J.setAttribute("data-split",$),z.elements}static revert(J,$){let Q=x0.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"),x0.delete(J),!0}static isSplit(J){return J.hasAttribute("data-split")}static getResult(J){return x0.get(J)?.result}}I.textSplitter={split:(J,$,Q)=>zJ.split(J,$,Q),revert:(J,$)=>zJ.revert(J,$),isSplit:zJ.isSplit};var kJ={alphanumeric:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",alpha:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",numeric:"0123456789",hex:"0123456789ABCDEF",binary:"01",katakana:"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲン",symbols:"!@#$%^&*+-=<>?/|~",blocks:"░▒▓█▄▀■□▪▫"},bJ=80,EJ=400,U7=[2,5],g0=new WeakMap,W0=new WeakMap,o0=new WeakMap;function X6(J){let $=J.parentElement;while($&&typeof $.hasAttribute==="function"&&$.hasAttribute("data-split-word-wrap"))$=$.parentElement;return $}function O7(J){if(!J)return kJ.alphanumeric;return Object.prototype.hasOwnProperty.call(kJ,J)?kJ[J]:J}function l0(J){return J[Math.floor(Math.random()*J.length)]}function _6(J){if(J===void 0){let[Z,j]=U7;return Z+Math.floor(Math.random()*(j-Z+1))}if(typeof J==="number")return Math.max(1,J);let[$,Q]=J;return $+Math.floor(Math.random()*(Q-$+1))}function Y0(J){return J===""||J===" "||J===" "||J===`
33
- `||J==="\t"}function I7(J){let $=J.textContent??"";if(!g0.has(J))g0.set(J,$);return $===" "?" ":$}function r9(J,$){if(!$||$.length===0)return{width:0,char:""};let Q=J.parentElement;if(!Q)return{width:0,char:""};let Z=document.createElement("span"),j=Z.style;j.position="absolute",j.left="-99999px",j.top="0",j.visibility="hidden",j.whiteSpace="pre",j.display="inline-block",j.pointerEvents="none";let q=[],z=new Set;for(let H of $){if(z.has(H))continue;z.add(H);let K=document.createElement("span");K.style.display="inline-block",K.textContent=H,Z.appendChild(K),q.push({el:K,c:H})}Q.appendChild(Z);let G=0,N="";try{for(let{el:H,c:K}of q){let Y=H.getBoundingClientRect().width;if(Y>G)G=Y,N=K}}finally{Q.removeChild(Z)}return{width:G,char:N}}function F7(J,$,Q=EJ,Z=!0,j="none",q=!1,z=""){let G=0,N=0,H="";if(j!=="none"&&$!=="board"){let K=null;for(let Y of J)if(!Y0(Y.textContent??""))G=Math.max(G,Y.offsetWidth),K??=Y;if(K&&z){let Y=r9(K,z);if(N=Y.width,H=Y.char,N>G)G=N}G=Math.max(G,8)+4}if(j==="container"&&$!=="board"&&H){let K=new Map;for(let Y of J){let W=X6(Y);if(!W)continue;let X=K.get(W);if(!X)X=[],K.set(W,X);X.push(Y)}for(let[Y,W]of K){if(o0.has(Y))continue;let X=Y.getBoundingClientRect().width,_=0;for(let B of W){if(Y0(B.textContent??""))continue;let O=B.getBoundingClientRect().width;if(N>O)_+=N-O}let U=Math.ceil(X+_+2);o0.set(Y,{display:Y.style.display,width:Y.style.width}),Y.style.display="inline-block",Y.style.width=`${U}px`}}if($==="flip"){let K=new Set;for(let Y of J){if(Y.style.display="inline-block",Y.style.backfaceVisibility="hidden",Y.style.verticalAlign="top",j==="cells"&&!Y0(Y.textContent??""))Y.style.width=`${G}px`,Y.style.textAlign="center";if(Y.parentElement&&!K.has(Y.parentElement))K.add(Y.parentElement),Y.parentElement.style.height=`${Y.parentElement.offsetHeight}px`}}else if($==="slide")for(let K of J){if(K.style.display="inline-block",K.parentElement)K.parentElement.style.overflow="hidden";if(j==="cells"&&!Y0(K.textContent??""))K.style.width=`${G}px`,K.style.textAlign="center"}else if($==="blur"||$==="scale"||$==="fade"||$==="none"){for(let K of J)if(K.style.display="inline-block",j==="cells"&&!Y0(K.textContent??""))K.style.width=`${G}px`,K.style.textAlign="center"}else if($==="board"){let K=0;if(Z){for(let Y of J)if(!Y0(Y.textContent??""))K=Math.max(K,Y.offsetWidth);K=Math.max(K,8)+4}for(let Y of J){let F=function(Z0){let t=document.createElement("span"),R=t.style;return R.display="block",R.position="absolute",R.left="0",R.width="100%",R.height="200%",R.fontSize=U.fontSize,R.fontFamily=U.fontFamily,R.fontWeight=U.fontWeight,R.color=U.color,R.lineHeight=`${O}px`,R.textAlign="center",R.setProperty("-webkit-text-fill-color",U.color),R.top=Z0,t},A=function(Z0){let t=document.createElement("div"),R=t.style;R.position="absolute",R.left="0",R.width="100%",R.height="50%",R.overflow="hidden",R.top=Z0?"50%":"0",R.zIndex="1";let U0=F(Z0?"-100%":"0");return t.appendChild(U0),[t,U0]},L=function(Z0="0"){let t=document.createElement("div"),R=t.style;R.position="absolute",R.left="0",R.top="0",R.width="100%",R.height="100%",R.overflow="hidden",R.backfaceVisibility="hidden";let U0=F(Z0);return t.appendChild(U0),[t,U0]};if(W0.has(Y))continue;let W=Y.textContent??"",X=Y0(W);if(X&&!q)continue;let _=X?" ":W,U=window.getComputedStyle(Y),B=Z?K:Y.offsetWidth,O=Y.offsetHeight;Y.textContent="",Y.style.display="inline-block",Y.style.position="relative",Y.style.width=`${B}px`,Y.style.height=`${O}px`,Y.style.perspective=`${Q}px`;let[k,K0]=A(!1);K0.textContent=_;let[R0,a0]=A(!0);a0.textContent=_;let k0=document.createElement("div"),i=k0.style;i.position="absolute",i.left="0",i.top="0",i.width="100%",i.height="50%",i.transformOrigin="center bottom",i.transformStyle="preserve-3d",i.zIndex="2";let[C0,b0]=L();b0.textContent=_;let[X0,E0]=L("-100%");X0.style.transform="rotateX(180deg)",E0.textContent=_,k0.appendChild(C0),k0.appendChild(X0);let n=document.createElement("div"),_0=n.style;_0.position="absolute",_0.left="0",_0.width="100%",_0.height="1px",_0.top="calc(50% - 0.5px)",_0.zIndex="3",_0.pointerEvents="none";let r0=document.createElement("div"),r=r0.style;if(r.position="absolute",r.left="0",r.width="100%",r.height="50%",r.top="50%",r.zIndex="2",r.pointerEvents="none",r.opacity="0",r.background="linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0) 100%)",Y.appendChild(k),Y.appendChild(R0),Y.appendChild(k0),Y.appendChild(r0),Y.appendChild(n),n.style.background=Z?"rgba(0, 0, 0, 0.6)":"rgba(0, 0, 0, 0.15)",Y.style.marginRight=Z?"2px":"1px",Z){k.style.background="linear-gradient(180deg, #2a2a2e 0%, #1e1e22 100%)",k.style.borderRadius="4px 4px 0 0",R0.style.background="linear-gradient(180deg, #1e1e22 0%, #16161a 100%)",R0.style.borderRadius="0 0 4px 4px",C0.style.background="linear-gradient(180deg, #2a2a2e 0%, #1e1e22 100%)",C0.style.borderRadius="4px 4px 0 0",X0.style.background="linear-gradient(180deg, #1e1e22 0%, #16161a 100%)",X0.style.borderRadius="0 0 4px 4px";for(let U0 of[K0,a0,b0,E0])U0.style.color="#e8e8ec",U0.style.setProperty("-webkit-text-fill-color","#e8e8ec")}W0.set(Y,{staticTop:k,staticBottom:R0,flapWrap:k0,flapFront:C0,flapBack:X0,splitLine:n,shadow:r0,staticTopText:K0,staticBottomText:a0,flapFrontText:b0,flapBackText:E0})}}}function A7(J,$,Q,Z,j,q,z,G){let N=[];for(let K=0;K<Q;K++){let Y=!z&&K===Q-1?$:l0(Z);N.push(Y)}let H=-1;return(K)=>{let Y=Math.min(K,0.9999)*Q,W=Math.floor(Y),X=Y-W,_=X>=0.5,U=W*2+(_?1:0);if(j!=="board"&&U!==H){if(_)J.textContent=z?l0(Z):N[W]??$;else J.textContent=W===0?$:z?l0(Z):N[W-1]??$;H=U}switch(j){case"flip":{let B=X<0.5?-90*(X/0.5):90*(1-(X-0.5)/0.5);E(J,"perspective",q,"px"),E(J,"rotateX",B,"deg"),G0(J);break}case"fade":{let B=X<0.5?1-X/0.5:(X-0.5)/0.5;J.style.opacity=String(B);break}case"slide":{let B=X<0.5?-100*(X/0.5):100*(1-(X-0.5)/0.5),O=X<0.5?1-X/0.5:(X-0.5)/0.5;E(J,"y",B,"%"),G0(J),J.style.opacity=String(O);break}case"blur":{let B=X<0.5?8*(X/0.5):8*(1-(X-0.5)/0.5);J.style.filter=`blur(${B}px)`;break}case"scale":{let B=X<0.5?1-X/0.5:(X-0.5)/0.5;E(J,"scale",B),G0(J);break}case"board":{let B=W0.get(J);if(!B)break;let O=W===0?$:z?l0(Z):N[W-1]??$,F=z?l0(Z):N[W]??$;B.staticTopText.textContent=F,B.flapFrontText.textContent=O,B.flapBackText.textContent=F,B.staticBottomText.textContent=O;let A=-180*X;B.flapWrap.style.transform=`rotateX(${A}deg)`;let L=Math.sin(X*Math.PI);B.shadow.style.opacity=String(L);break}default:break}if(G&&G.length>0){let B=!1;for(let O of G){let F=X<0.5?1-X/0.5:(X-0.5)/0.5,A=O.from+(O.to-O.from)*F;if(O.isTransform)E(J,O.prop,A,O.unit||void 0),B=!0;else J.style[O.prop]=O.unit?`${A}${O.unit}`:String(A)}if(B)G0(J)}}}function L7(J,$,Q,Z){return()=>{if(Q==="board"){let j=W0.get(J);if(j)j.staticTopText.textContent=$,j.staticBottomText.textContent=$,j.flapFrontText.textContent=$,j.flapBackText.textContent=$,j.flapWrap.style.transform="",j.shadow.style.opacity="0";if(Z&&Z.length>0){for(let q of Z)if(!q.isTransform)J.style[q.prop]=q.unit?`${q.to}${q.unit}`:String(q.to)}return}if(J.textContent=$,Q==="flip"||Q==="scale")y(J,!0);else if(Q==="slide")y(J,!0),J.style.opacity="";else if(Q==="fade")J.style.opacity="";else if(Q==="blur")J.style.filter="";if(Z&&Z.length>0){for(let j of Z)if(j.isTransform)E(J,j.prop,j.to,j.unit||void 0);else J.style[j.prop]=j.unit?`${j.to}${j.unit}`:String(j.to);if(Z.some((j)=>j.isTransform))G0(J)}}}class s0{static prepare(J,$,Q=!1,Z){let j=$.type??"flip",q=O7($.charset),z=$.perspective??EJ,G=$.styledBoard??!0,N=$.stableWidth??!1,H=N==="container"?"container":N==="cells"||N===!0?"cells":"none",K=$.preserveWhitespaceCells??!1,Y=[];for(let X of J){let _=I7(X),U=X.textContent??"",B=Y0(U),O=B&&K&&j==="board";if(B&&!O)continue;let F=O?" ":_;Y.push({el:X,target:F,isBlankCell:O})}F7(J,j,z,G,H,K,q);let W=[];for(let{el:X,target:_,isBlankCell:U}of Y)if(U)W.push({el:X,render:()=>{},finalize:()=>{}});else{let B=_6($.cycles);W.push({el:X,render:A7(X,_,B,q,j,z,Q,Z),finalize:L7(X,_,j,Z)})}if(W.length===0&&J.length>0){if(J.some((_)=>_.textContent===""))console.warn("[Motion.page SDK] TextFlapper produced zero drivers.","The element likely contains detached char spans from a previous split","(textContent was cleared but spans remain registered).",`Effect type: '${j}'.`,"Fix: call Motion(name).kill() and Motion.reset(element) before re-animating, or mutate innerHTML/textContent on the ORIGINAL container (not the split fragments).",{charElements:J,type:j})}return W}static flap(J,$,Q,Z=!1){let j=s0.prepare(J,$,Z);if(j.length===0)return{kill(){},finished:Promise.resolve(),isComplete:!0};let q=_6($.cycles),z=q*2*bJ+Math.max(0,q-1)*0.5*bJ,G=()=>{},N=new Promise((B)=>{G=B}),H=!1,K=0,Y=0,W=[],X=0;for(let B=0;B<J.length;B++){let O=J[B].textContent??"";if(Y0(O))continue;W.push(Q?.[B]??X*bJ*2),X++}let _=performance.now();function U(){if(H)return;let B=performance.now(),O=!0;for(let F=0;F<j.length;F++){let A=j[F],L=B-_-W[F];if(L<0){O=!1;continue}if(Z){let k=L%z/z;A.render(k),O=!1}else{let k=Math.min(L/z,1);if(A.render(k),k>=1)A.finalize();else O=!1}}if(O&&!Z)K=j.length,G();else Y=requestAnimationFrame(U)}if(Y=requestAnimationFrame(U),Z)G();return{kill(){if(H)return;H=!0,cancelAnimationFrame(Y);for(let B of j)B.finalize();G()},get finished(){return N},get isComplete(){return H||K===j.length}}}static revert(J){for(let $ of J){let Q=W0.get($);if(Q)Q.staticTop.remove(),Q.staticBottom.remove(),Q.flapWrap.remove(),Q.splitLine.remove(),Q.shadow.remove(),W0.delete($),$.style.perspective="",$.style.position="",$.style.width="",$.style.height="",$.style.marginRight="";let Z=g0.get($);if(Z!==void 0)$.textContent=Z,g0.delete($);if($.style.display="",$.style.backfaceVisibility="",$.style.overflow="",$.style.transform="",$.style.transition="",$.style.opacity="",$.style.filter="",$.style.width="",$.style.textAlign="",$.style.verticalAlign="",$.parentElement)$.parentElement.style.overflow="",$.parentElement.style.height="";let j=X6($);if(j){let q=o0.get(j);if(q)j.style.display=q.display,j.style.width=q.width,o0.delete(j)}}}}I.textFlapper={prepare:(J,$,Q,Z)=>s0.prepare(J,$,Q,Z),flap:(J,$,Q,Z)=>s0.flap(J,$,Q,Z),revert:(J)=>s0.revert(J)};class M7{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 z=0;z<Q;z++)q[j[z].originalIndex]=j[z].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,z)=>{let G=Math.abs(z-j);return{originalIndex:z,order:G}})}case"edges":return J.map((j,q)=>{let z=Math.min(q,Q-1-q);return{originalIndex:q,order:z}});case"random":{let j=J.map((q,z)=>({originalIndex:z,order:Math.random()}));return j.sort((q,z)=>q.order-z.order),j.forEach((q,z)=>{q.order=z}),j}default:if(typeof Z==="number"){let j=Math.max(0,Math.min(Q-1,Z));return J.map((q,z)=>{let G=Math.abs(z-j);return{originalIndex:z,order:G}})}return J.map((j,q)=>({originalIndex:q,order:q}))}}static getGridOrdering(J,$){let Q,Z;if($.grid==="auto"){let G=this.detectGrid(J);Q=G.cols,Z=G.rows}else[Q,Z]=$.grid;let j=$.from??"start",q=$.axis??"x",z=J.map((G,N)=>{let H=N%Q,K=Math.floor(N/Q);return{originalIndex:N,col:H,row:K}});if(j==="random"){let G=z.map((N)=>({originalIndex:N.originalIndex,order:Math.random()}));return G.sort((N,H)=>N.order-H.order),G.forEach((N,H)=>{N.order=H}),G}return z.map((G)=>{let N;if(typeof j==="number"){let H=j%Q,K=Math.floor(j/Q);N=q==="x"?Math.abs(G.col-H)+Math.abs(G.row-K)*0.5:Math.abs(G.row-K)+Math.abs(G.col-H)*0.5}else if(j==="center"){let H=(Q-1)/2,K=(Z-1)/2;N=Math.abs(G.col-H)+Math.abs(G.row-K)}else if(j==="edges"){let H=Math.min(G.col,Q-1-G.col),K=Math.min(G.row,Z-1-G.row);N=Math.min(H,K)}else if(j==="end")N=q==="x"?(Z-1-G.row)*Q+(Q-1-G.col):(Q-1-G.col)*Z+(Z-1-G.row);else N=q==="x"?G.row*Q+G.col:G.col*Z+G.row;return{originalIndex:G.originalIndex,order:N}})}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 z=q.getBoundingClientRect(),G=Math.round(z.top);Q.set(G,(Q.get(G)||0)+1)});let Z=Q.size;return{cols:Math.ceil(J.length/Z),rows:Z}}}I.stagger={resolve:(J,$)=>M7.resolve(J,$)};function t9(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(),z=j.width===0?1:j.width,G=j.height===0?1:j.height,N=j.left+z/2,H=j.top+G/2,K=q.left+q.width/2,Y=q.top+q.height/2,W=K-N,X=Y-H,_=q.width/z,U=q.height/G;if(!Q)return{dx:W,dy:X,sx:_,sy:U,sourceWidth:j.width,sourceHeight:j.height,targetWidth:q.width,targetHeight:q.height};let B=J.offsetParent??document.documentElement,O=B.getBoundingClientRect(),F=B.scrollLeft??0,A=B.scrollTop??0;return{dx:W,dy:X,sx:_,sy:U,sourceWidth:j.width,sourceHeight:j.height,targetWidth:q.width,targetHeight:q.height,sourceLeft:J.offsetLeft,sourceTop:J.offsetTop,targetLeft:q.left-O.left+F,targetTop:q.top-O.top+A}}function D7(J,$,Q,Z){if(!Z||Z==="px")return Q;if(Z==="%"){let j=J,q=$==="x"?j.offsetWidth:j.offsetHeight;return Q/100*q}if(Z==="vw")return Q/100*window.innerWidth;if(Z==="vh")return Q/100*window.innerHeight;if(Z==="vmin")return Q/100*Math.min(window.innerWidth,window.innerHeight);if(Z==="vmax")return Q/100*Math.max(window.innerWidth,window.innerHeight);if(Z==="em"){let j=parseFloat(window.getComputedStyle(J).fontSize);return Q*j}if(Z==="rem"){let j=parseFloat(window.getComputedStyle(document.documentElement).fontSize);return Q*j}return Q}var o=0.01,i0=0.001;function e9(J,$,Q,Z){let{absolute:j=!1,scale:q=!0,resize:z=!1}=Q;if($ instanceof HTMLElement)y($,!1);let G=t9($,Q.target,j);if(!G)return;if(!j)if(z){let N=G.dx-(G.targetWidth-G.sourceWidth)/2,H=G.dy-(G.targetHeight-G.sourceHeight)/2;if(Math.abs(N)>o){let K=Z.acquire();K.init($,"x",0,N,"px"),J.addPropTween(K)}if(Math.abs(H)>o){let K=Z.acquire();K.init($,"y",0,H,"px"),J.addPropTween(K)}if(Math.abs(G.targetWidth-G.sourceWidth)>o){let K=Z.acquire();K.init($,"width",G.sourceWidth,G.targetWidth,"px"),J.addPropTween(K)}if(Math.abs(G.targetHeight-G.sourceHeight)>o){let K=Z.acquire();K.init($,"height",G.sourceHeight,G.targetHeight,"px"),J.addPropTween(K)}}else{let N=Q0($,"x"),H=Q0($,"y"),K=pJ($,"x"),Y=pJ($,"y"),W=D7($,"x",N,K),X=D7($,"y",H,Y),_=W+G.dx,U=X+G.dy;if(Math.abs(_-W)>o||Math.abs(W)>o||Math.abs(_)>o){let B=Z.acquire();B.init($,"x",W,_,"px"),J.addPropTween(B)}if(Math.abs(U-X)>o||Math.abs(X)>o||Math.abs(U)>o){let B=Z.acquire();B.init($,"y",X,U,"px"),J.addPropTween(B)}if(q){let B=Q0($,"scaleX"),O=Q0($,"scaleY"),F=B*G.sx,A=O*G.sy;if(Math.abs(F-B)>i0||Math.abs(B-1)>i0||Math.abs(F-1)>i0){let L=Z.acquire();L.init($,"scaleX",B,F,""),J.addPropTween(L)}if(Math.abs(A-O)>i0||Math.abs(O-1)>i0||Math.abs(A-1)>i0){let L=Z.acquire();L.init($,"scaleY",O,A,""),J.addPropTween(L)}}}else{let N=$;if(window.getComputedStyle(N).position==="static")N.style.position="absolute";let{sourceLeft:K,sourceTop:Y,targetLeft:W,targetTop:X}=G;if(Math.abs(W-K)>o){let _=Z.acquire();_.init($,"left",K,W,"px"),J.addPropTween(_)}if(Math.abs(X-Y)>o){let _=Z.acquire();_.init($,"top",Y,X,"px"),J.addPropTween(_)}if(q){if(Math.abs(G.targetWidth-G.sourceWidth)>o){let _=Z.acquire();_.init($,"width",G.sourceWidth,G.targetWidth,"px"),J.addPropTween(_)}if(Math.abs(G.targetHeight-G.sourceHeight)>o){let _=Z.acquire();_.init($,"height",G.sourceHeight,G.targetHeight,"px"),J.addPropTween(_)}}}}function J$(J,$,Q,Z){J.setPendingFitSetup((z)=>e9(J,$,Q,z)),J.setLazyStartCapture(!0);let{absolute:j=!1,resize:q=!1}=Q;J.setFitCleanup(()=>{if($ instanceof HTMLElement){if(y($,!0),q)$.style.width="",$.style.height="";if(j)$.style.width="",$.style.height="",$.style.left="",$.style.top=""}})}I.fit={registerPendingSetup:J$};var VJ=["desktop","laptop","tablet","phone"],R7="[Motion] ResponsiveManager:";function $$(J,$){let{laptops:Q,tablets:Z,phones:j}=$,q="screen";if(J==="desktop")q+=` and (min-width: ${Q+1}px)`;else if(J==="laptop")q+=` and (min-width: ${Z+1}px)`;else if(J==="tablet")q+=` and (min-width: ${j+1}px)`;if(J==="laptop")q+=` and (max-width: ${Q}px)`;else if(J==="tablet")q+=` and (max-width: ${Z}px)`;else if(J==="phone")q+=` and (max-width: ${j}px)`;return q}class k7{variants={};queries=[];activeTier=null;activeTimeline=null;destroyed=!1;register(J,$){this.destroy(),this.destroyed=!1,this.variants=J;let Q=typeof window<"u"?window.matchMedia:void 0;if(typeof Q!=="function"){this.activateTier("desktop");return}for(let Z of VJ){let j=Q.call(window,$$(Z,$)),q=()=>this.handleChange();if(j.addEventListener)j.addEventListener("change",q);else if(j.addListener)j.addListener(q);this.queries.push({tier:Z,mql:j,listener:q})}this.handleChange()}handleChange(){if(this.destroyed)return;let J=this.queries.find((Q)=>Q.mql.matches),$=J?J.tier:"desktop";if($!==this.activeTier)this.activateTier($)}activateTier(J){let $;for(let Z=VJ.indexOf(J);Z>=0;Z--)if(this.variants[VJ[Z]]){$=VJ[Z];break}this.activeTier=J,this.killActive();let Q=$&&this.variants[$];if(!Q)return;try{let Z=Q();this.activeTimeline=Z&&typeof Z.kill==="function"?Z:null}catch(Z){console.error(R7,"error building variant",Z),this.activeTimeline=null}}killActive(){if(this.activeTimeline){try{this.activeTimeline.kill()}catch(J){console.error(R7,"error killing variant",J)}this.activeTimeline=null}}getActiveTier(){return this.activeTier}destroy(){if(this.destroyed)return;this.destroyed=!0;for(let J of this.queries)if(J.mql.removeEventListener)J.mql.removeEventListener("change",J.listener);else if(J.mql.removeListener)J.mql.removeListener(J.listener);this.queries=[],this.killActive(),this.activeTier=null}}I.responsive={create:()=>new k7};var w7=(J)=>J,Q$=w7,v={in:(J)=>J*J,out:(J)=>J*(2-J),inOut:(J)=>J<0.5?2*J*J:-1+(4-2*J)*J},M0={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},D0={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},a={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 wJ={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},xJ={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}},CJ={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 x7=(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}}},SJ=x7();var C7=(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:(z)=>{if(z===0)return 0;if(z===1)return 1;return-(Q*Math.pow(2,10*(z-=1))*Math.sin((z-Z)*(2*Math.PI)/$))},out:(z)=>{if(z===0)return 0;if(z===1)return 1;return Q*Math.pow(2,-10*z)*Math.sin((z-Z)*(2*Math.PI)/$)+1},inOut:(z)=>{if(z===0)return 0;if(z===1)return 1;if((z*=2)<1)return-0.5*(Q*Math.pow(2,10*(z-=1))*Math.sin((z-q)*(2*Math.PI)/j));return Q*Math.pow(2,-10*(z-=1))*Math.sin((z-q)*(2*Math.PI)/j)*0.5+1}}},PJ=C7(),b7=(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},n0={in:(J)=>1-b7(1-J),out:b7,inOut:(J)=>{if(J<0.5)return n0.in(J*2)*0.5;return n0.out(J*2-1)*0.5+0.5}},NJ=(J=0.7,$=0.7,Q=!1)=>{let Z=J!==1?$:0,j=(1-J)/2,q=j+J,z=Q;return(G)=>{let N=G+(0.5-G)*Z;if(G<j){let H=1-G/j;if(z)return 1-H*H;return N-H*H*H*H*N}else if(G>q){let H=(G-q)/j;if(z)return G===1?0:1-H*H;return N+(G-N)*H*H*H*H}return z?1:N}},E7={in:NJ(0.7,0.7,!1),out:NJ(0.7,0.7,!1),inOut:NJ(0.7,0.7,!1)},vJ=(J=1,$=20,Q=!1)=>{let Z=[],j=1/$;for(let q=0;q<$;q++){let z=q*j,N=((q*1327+531)%1000/1000-0.5)*J*0.4,H=z+N;Z.push({x:z,y:Q?Math.max(0,Math.min(1,H)):H})}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 z=0,G=Z.length-1;while(z<G-1){let Y=z+G>>1;if(Z[Y].x<=q)z=Y;else G=Y}let N=Z[z],H=Z[G],K=(q-N.x)/(H.x-N.x);return N.y+(H.y-N.y)*K}},Z$={in:vJ(1,20,!0),out:vJ(1,20,!0),inOut:vJ(1,20,!0)},TJ=(J)=>{return($)=>{if($>=1)return 1;return Math.floor($*J)/J}},yJ={in:TJ(12),out:TJ(12),inOut:TJ(12)},V7={linear:w7,none:Q$,power1:v.out,"power1.in":v.in,"power1.out":v.out,"power1.inout":v.inOut,power2:M0.out,"power2.in":M0.in,"power2.out":M0.out,"power2.inout":M0.inOut,power3:D0.out,"power3.in":D0.in,"power3.out":D0.out,"power3.inout":D0.inOut,power4:a.out,"power4.in":a.in,"power4.out":a.out,"power4.inout":a.inOut,quad:v.out,"quad.in":v.in,"quad.out":v.out,"quad.inout":v.inOut,cubic:M0.out,"cubic.in":M0.in,"cubic.out":M0.out,"cubic.inout":M0.inOut,quart:D0.out,"quart.in":D0.in,"quart.out":D0.out,"quart.inout":D0.inOut,quint:a.out,"quint.in":a.in,"quint.out":a.out,"quint.inout":a.inOut,strong:a.out,"strong.in":a.in,"strong.out":a.out,"strong.inout":a.inOut,sine:wJ.out,"sine.in":wJ.in,"sine.out":wJ.out,"sine.inout":wJ.inOut,expo:xJ.out,"expo.in":xJ.in,"expo.out":xJ.out,"expo.inout":xJ.inOut,circ:CJ.out,"circ.in":CJ.in,"circ.out":CJ.out,"circ.inout":CJ.inOut,back:SJ.out,"back.in":SJ.in,"back.out":SJ.out,"back.inout":SJ.inOut,elastic:PJ.out,"elastic.in":PJ.in,"elastic.out":PJ.out,"elastic.inout":PJ.inOut,bounce:n0.out,"bounce.in":n0.in,"bounce.out":n0.out,"bounce.inout":n0.inOut,slow:E7.inOut,"slow.in":v.out,"slow.out":v.out,"slow.inout":v.out,slowmo:E7.inOut,"slowmo.in":v.out,"slowmo.out":v.out,"slowmo.inout":v.out,rough:Z$.inOut,"rough.in":v.out,"rough.out":v.out,"rough.inout":v.out,steps:yJ.inOut,"steps.in":yJ.in,"steps.out":yJ.out,"steps.inout":yJ.inOut},j$={back:(J)=>x7(J),elastic:(J,$)=>C7(J,$),slow:(J,$,Q)=>{let Z=NJ(J,$,Q===1);return{in:Z,out:Z,inOut:Z}},slowmo:(J,$,Q)=>{let Z=NJ(J,$,Q===1);return{in:Z,out:Z,inOut:Z}},rough:(J,$,Q)=>{let Z=vJ(J,$,Q===1);return{in:Z,out:Z,inOut:Z}},steps:(J)=>{let $=TJ(J??12);return{in:$,out:$,inOut:$}}},q$=/^(\w+)(?:\.(\w+))?\(([^)]*)\)$/;function S7(J){let $=J.toLowerCase();if(V7[$])return V7[$];let Q=q$.exec($);if(Q){let[,Z,j,q]=Q,z=j$[Z];if(z){let G=q.split(",").map((N)=>N.trim()).filter((N)=>N.length>0).map(Number);if(G.every((N)=>!isNaN(N))){let N=z(...G),H=j||"out",Y=N[H==="inout"?"inOut":H];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)`),v.out}class B6{_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;_activationCallback=null;init(J,$,Q,Z,j,q){return this._id=J,this._targets=$,this._duration=Q,this._delay=Z,this._easingFn=S7(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 Q=this.applyEasing(J),Z=this._propTweens;while(Z){if(!$||$(Z))Z.render(Q);Z=Z.next}}renderAtTime(J,$){let Q=Math.max(0,J),Z=this._duration,j=this._delay,q=this._currentRepeat;if(Z===0){let z=Q>=j?1:0;this._time=Q,this._progress=z,this.render(z,$)}else{let z=Math.max(0,Q-j);if(this._repeat===0){let G=Math.min(1,z/Z);this._time=Math.min(Z,z),this._progress=G,this.render(G,$)}else{let G=this._repeatDelay,N=Z+G,H=this._repeat===-1?1/0:Z*(this._repeat+1)+G*this._repeat,K=this._repeat===-1?z:Math.min(z,H),Y=N>0?Math.floor(K/N):0,W=K-Y*N,X=W>Z,_=Z>0?Math.min(1,W/Z):1,U=this._yoyo&&Y%2===1;if(X)_=U?0:1;else if(U)_=1-_;this._currentRepeat=this._repeat===-1?Y:Math.min(Y,this._repeat),this._isReversed=U,this._progress=_,this._time=Z*_,this.render(_,$)}}if(this._isActive){if(!this._startFired){this._startFired=!0;try{this._onStart?.()}catch(z){console.error("[Motion] onStart callback error:",z)}}try{this._onUpdate?.(this._progress)}catch(z){console.error("[Motion] onUpdate callback error:",z)}if(this._currentRepeat>q)try{this._onRepeat?.(this._currentRepeat)}catch(z){console.error("[Motion] onRepeat callback error:",z)}if(!this._completeFired&&this._repeat!==-1){if(Q>=this.totalDuration()){this._completeFired=!0;try{this._onComplete?.()}catch(z){console.error("[Motion] onComplete callback error:",z)}}}}}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._activationCallback?.(),this;if(this._isActive&&!this._isReversed)return this;return this._isActive=!0,this._isReversed=!1,this._activationCallback?.(),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._activationCallback?.(),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._activationCallback?.(),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}setActivationCallback(J){this._activationCallback=J}captureStartValues(){if(!this._needsStartCapture||this._startCaptured)return;if(this._pendingFitSetup){let $=this._propTweens;while($){let Q=$.next;A0.release($),$=Q}this._propTweens=null,this._lastPropTween=null,this._pendingFitSetup(A0),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"&&$0(Q)){let Z=I.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"&&c(Q)){let Z=I.filter?.getCurrentFilter($);if(Z&&J.endFilters){let j=I.filter.mergeFilterArrays(Z,J.endFilters);J.startFilters=j.start,J.endFilters=j.end}}else if(J.valueType==="clipPath"&&h0(Q)){let Z=I.clipPath;if(Z&&J.endClipPath){let j=Z.getCurrentClipPath($);if(j&&Z.canInterpolate(j,J.endClipPath))J.startClipPath=j}}else{let Z=Q0($,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,this._activationCallback=null;let J=A0,$=this._propTweens;while($){let Q=$.next;J.release($),$=Q}this._propTweens=null,this._lastPropTween=null}}var HJ=new qJ(()=>new B6,100),P7={acquire:()=>HJ.acquire(),release:(J)=>HJ.release(J),getPoolSize:()=>HJ.getPoolSize(),getTotalCreated:()=>HJ.getTotalCreated(),clear:()=>HJ.clear()};class V{static instance;animations=[];animationIdToIndex=new Map;nextAnimationId=1;totalCreated=0;_animationSnapshot=[];timelines=new Map;_captureTarget=null;ticker;_tickerSubscribed=!1;animationPool;propTweenPool;constructor(){this.ticker=T.getInstance(),this.animationPool=P7,this.propTweenPool=A0}static getInstance(){if(!V.instance)V.instance=new V,P.setEngineRegisterCallback((J,$)=>{let Q=V.instance;if(!Q.hasTimeline(J))Q.registerTimeline(J,$)}),P.setEngineActivationCallback(()=>{V.instance._ensureTickerSubscription()}),u.setCreateAnimationCallback((J,$,Q,Z,j,q,z,G)=>{return V.instance.createAnimation(J,$,Q,Z,j,q,z,G)});return V.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 z=$[j];if(z.isTimelineChild())continue;if(z.isActive()){if(z.update(J),!z.isActive()&&!z.isTimelineChild())Z.push(z.getId())}}for(let j of Z)this.unregisterAnimation(j);for(let j of this.timelines.values())if(j.isActive())j.update(J);this._releaseTickerIfIdle()};_ensureTickerSubscription(){if(this._tickerSubscribed)return;this.ticker.add(this.update,0),this._tickerSubscribed=!0}_hasActiveWork(){for(let J=0,$=this.animations.length;J<$;J++){let Q=this.animations[J];if(!Q.isTimelineChild()&&Q.isActive())return!0}for(let J of this.timelines.values())if(J.isActive())return!0;return!1}_releaseTickerIfIdle(){if(!this._tickerSubscribed||this._hasActiveWork())return;this.ticker.remove(this.update),this._tickerSubscribed=!1}createAnimation(J,$,Q,Z,j,q,z,G){let N=G?.stagger;if(N&&J.length>1)return this.createStaggeredAnimations(J,$,Q,Z,j,q,z,N,G);let H=this.animationPool.acquire(),K=this.registerAnimation(H);if(H.init(K,J,Q,Z,j,G),this.setupPropertyTweens(H,J,$,q,z),Q===0)H.render(1);else if(q&&!G?._skipInitialRender)H.render(0);return H}createStaggeredAnimations(J,$,Q,Z,j,q,z,G,N){if(!I.stagger){let Y=this.animationPool.acquire(),W=this.registerAnimation(Y);if(Y.init(W,J,Q,Z,j,N),this.setupPropertyTweens(Y,J,$,q,z),Q===0)Y.render(1);else if(q&&!N?._skipInitialRender)Y.render(0);return[Y]}let H=I.stagger.resolve(J,G),K=[];for(let Y=0;Y<J.length;Y++){let W=J[Y],X=H[Y],_=this.animationPool.acquire(),U=this.registerAnimation(_);if(_.init(U,[W],Q,Z+X,j,N),this.setupPropertyTweens(_,[W],$,q,z),Q===0)_.render(1);else if(q&&!N?._skipInitialRender)_.render(0);K.push(_)}return K}setupPropertyTweens(J,$,Q,Z,j){let q=v7(y7(Q)),z=j?v7(y7(j)):void 0,G=Object.keys(q),N=z?Object.keys(z):[],H=[...new Set([...G,...N])],K="perspective"in q,Y=z&&"perspective"in z,W=K&&Y;for(let X of $){if(!W&&(K||Y)&&X instanceof Element){let _=K?q.perspective:z.perspective,U=typeof _==="number"?_:parseFloat(String(_))||0;if(U>0)E(X,"perspective",U,"px"),X.style.transform=C(X)}for(let _ of H){if(_==="perspective"&&!W)continue;let U=q[_],B=JJ(X,_,U,z?z[_]:void 0),O=this.propTweenPool.acquire(),F=Z&&!j;switch(B.type){case"color":{let A=F?B.endColor:B.startColor,L=F?B.startColor:B.endColor;O.initColor(X,_,A,L);break}case"filter":{let A=F?B.endFilters:B.startFilters,L=F?B.startFilters:B.endFilters;O.initFilter(X,_,A,L);break}case"clipPath":{let A=F?B.endClipPath:B.startClipPath,L=F?B.startClipPath:B.endClipPath;O.initClipPath(X,_,A,L);break}case"scalar":{let A=F?B.endValue:B.startValue,L=F?B.startValue:B.endValue,k=F?B.endUnit:B.startUnit,K0=F?B.startUnit:B.endUnit;O.init(X,_,A,L,B.unit,k,K0);break}case"drawSVG":{let A=F?B.endDraw:B.startDraw,L=F?B.startDraw:B.endDraw;O.initDrawSVG(X,_,A,L,B.length);break}case"path":{let A=F?B.endProgress:B.startProgress,L=F?B.startProgress:B.endProgress;O.initPath(X,_,B.pathData,B.pathLength,A,L,B.rotate,B.alignOffset,B.pathOffset,B.pathScale);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($)),J.setActivationCallback(()=>this._ensureTickerSubscription()),$}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),this._releaseTickerIfIdle()}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(),this._releaseTickerIfIdle()}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],z=q.getTargets();for(let G of z)if(G instanceof Element&&$.has(G)){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){if(this._captureTarget)this._captureTarget.add(J);let $=this.timelines.get(J);if(!$){if($=new P(J),!this.timelines.has(J))this.timelines.set(J,$),$.setUnregisterCallback(()=>this.removeTimeline(J))}return $}startCapture(J){this._captureTarget=J}stopCapture(){this._captureTarget=null}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),this._releaseTickerIfIdle()}killAllTimelines(){for(let J of this.timelines.values())J.kill();this.timelines.clear(),this._releaseTickerIfIdle()}killEverything(){this.killAllTimelines(),this.killAll(),T6()}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 y7(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 G=Z[1],H=Z[2].match(/[-+]?\d*\.?\d+(?:e[-+]?\d+)?[a-z%]*/gi)||[];switch(G){case"perspective":{if(!("perspective"in J))j.perspective=H[0]||"0px",q=!0;break}case"translate":{if(H[0]&&!("x"in J))j.x=H[0],q=!0;if(H[1]&&!("y"in J))j.y=H[1],q=!0;break}case"translate3d":{if(H[0]&&!("x"in J))j.x=H[0],q=!0;if(H[1]&&!("y"in J))j.y=H[1],q=!0;if(H[2]&&!("z"in J))j.z=H[2],q=!0;break}case"translateX":{if(H[0]&&!("x"in J))j.x=H[0],q=!0;break}case"translateY":{if(H[0]&&!("y"in J))j.y=H[0],q=!0;break}case"translateZ":{if(H[0]&&!("z"in J))j.z=H[0],q=!0;break}case"rotate":{if(H[0]&&!("rotate"in J))j.rotate=H[0],q=!0;break}case"rotateX":{if(H[0]&&!("rotateX"in J))j.rotateX=H[0],q=!0;break}case"rotateY":{if(H[0]&&!("rotateY"in J))j.rotateY=H[0],q=!0;break}case"rotateZ":{if(H[0]&&!("rotateZ"in J))j.rotateZ=H[0],q=!0;break}case"scale":{if(H[0]&&!("scale"in J))j.scale=parseFloat(H[0]),q=!0;break}case"scaleX":{if(H[0]&&!("scaleX"in J))j.scaleX=parseFloat(H[0]),q=!0;break}case"scaleY":{if(H[0]&&!("scaleY"in J))j.scaleY=parseFloat(H[0]),q=!0;break}case"scaleZ":{if(H[0]&&!("scaleZ"in J))j.scaleZ=parseFloat(H[0]),q=!0;break}case"skew":{if(H[0]&&!("skewX"in J))j.skewX=H[0],q=!0;if(H[1]&&!("skewY"in J))j.skewY=H[1],q=!0;break}case"skewX":{if(H[0]&&!("skewX"in J))j.skewX=H[0],q=!0;break}case"skewY":{if(H[0]&&!("skewY"in J))j.skewY=H[0],q=!0;break}default:break}}if(!q)return J;let z={...j};for(let[G,N]of Object.entries(J)){if(G==="transform")continue;z[G]=N}return z}function v7(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,(z,G)=>G.toUpperCase());Q[q]=j}else Q[Z]=j;return Q}class hJ{_fn;_timelineNames=new Set;_reverted=!1;constructor(J){this._fn=J,this._execute()}revert(){if(this._reverted)return;let J=V.getInstance();for(let $ of this._timelineNames)if(J.hasTimeline($))J.getTimeline($).kill();if(typeof document<"u")document.querySelectorAll("[data-scrolltrigger-spacer]").forEach(($)=>$.remove()),document.querySelectorAll("[data-scrolltrigger-markers]").forEach(($)=>$.remove());this._timelineNames.clear(),this._reverted=!0}refresh(){this.revert(),this._reverted=!1,this._execute()}add(J){this._reverted=!1,this._execute(J)}getTimelineNames(){return Array.from(this._timelineNames)}_execute(J){let $=V.getInstance();$.startCapture(this._timelineNames);try{(J||this._fn)()}finally{$.stopCapture()}}}function G$(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 z$(J,$,Q){if(Q===void 0)return(Z)=>Math.min($,Math.max(J,Z));return Math.min($,Math.max(J,Q))}function N$(J,$,Q){let Z=J+Math.random()*($-J);if(Q&&Q>0)return Math.round(Z/Q)*Q;return Z}function H$(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],z=Math.abs(Z-q);for(let G=1;G<j.length;G++){let N=Math.abs(Z-j[G]);if(N<z)z=N,q=j[G]}return q};if($===void 0)return Q;return Q($)}function Y$(J,$,Q){return J+($-J)*Q}function K$(J,$,Q,Z,j){let q=(z)=>{let G=(z-J)/($-J);return Q+G*(Z-Q)};if(j===void 0)return q;return q(j)}function X$(J,$,Q){let Z=(j)=>(j-J)/($-J);if(Q===void 0)return Z;return Z(Q)}function _$(J,$,Q){let Z=$-J,j=(q)=>{return((q-J)%Z+Z)%Z+J};if(Q===void 0)return j;return j(Q)}var W6={toArray:G$,clamp:z$,random:N$,snap:H$,interpolate:Y$,mapRange:K$,normalize:X$,wrap:_$};function s(J,$,Q){let j=V.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}s.reset=function(J){V.getInstance();let $=YJ(J),Q=[];for(let Z of $)if(Z instanceof Element)Q.push(Z);if(Q.length>0)V.getInstance().killAnimationsForTargets(Q);for(let Z of $){if(!(Z instanceof Element))continue;if(I.textSplitter?.isSplit?.(Z))I.textSplitter?.revert?.(Z);y(Z),I.styleReset?.clearAnimationStylesAndUnregister?.(Z),I.styleReset?.clearPinStylesAndUnregister?.(Z)}};s.set=function(J,$){V.getInstance();let Q=new P;Q._addEntry(J,{to:$,duration:0}),Q.kill(!1)};s.get=function(J){let $=V.getInstance();return $.hasTimeline(J)?$.getTimeline(J):void 0};s.has=function(J){return V.getInstance().hasTimeline(J)};s.getNames=function(){return V.getInstance().getTimelineNames()};s.kill=function(J){let $=V.getInstance();if($.hasTimeline(J))$.getTimeline(J).kill()};s.killAll=function(){V.getInstance().killEverything()};s.refreshScrollTriggers=function(){I.triggerManager?.getInstance?.()?.refreshScrollTriggers()};s.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())};s.context=function(J){return new hJ(J)};s.utils=W6;s.responsive=function(J,$,Q){V.getInstance();let Z=I.responsive?.create();if(!Z){let j=$.desktop;if(typeof j==="function")try{j()}catch(q){console.error("[Motion] responsive fallback build failed",q)}return}return Z.register($,Q),Z};var B$=s;var W$={};export{W$ as Types,P as Timeline,W6 as MotionUtils,hJ as MotionContext,B$ as Motion};
33
+ `,F.appendChild(A),F},Y=K("scroller-start",Q,"right"),_=K("scroller-end",Z,"right"),X=K("start",Q,"left"),B=K("end",Z,"left");if(!this._triggerElement)X.style.display="none",B.style.display="none";if(this._markerContainer.appendChild(Y),this._markerContainer.appendChild(_),this._markerContainer.appendChild(X),this._markerContainer.appendChild(B),this._markers={scrollerStart:Y,scrollerEnd:_,elementStart:X,elementEnd:B},q){let U=this._scroller;if(window.getComputedStyle(U).position==="static")U.style.position="relative";U.appendChild(this._markerContainer)}else document.body.appendChild(this._markerContainer),this._markerContainer.style.position="fixed";this._scrollerStartOffset=H,this._scrollerEndOffset=N,this._cacheElementPositions(G)}_cacheElementPositions(J){if(!this._triggerElement){this._cachedElPositionValid=!1;return}let $=g(this._triggerElement),Q=N0(this._startConfig.split(" ")[0]||"top",$.height,J),Z=this._endConfig.startsWith("+=")?Q:N0(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}}var QJ=new Map;function A9(J){if(typeof window<"u"&&J===window)return window.scrollY||window.pageYOffset||0;if(typeof Element<"u"&&J instanceof Element)return J.scrollTop;return 0}function t6(J,$){let Q=QJ.get(J);if(!Q){let Z=()=>{let j=QJ.get(J);if(!j||j.callbacks.size===0)return;let q=A9(J);e0(()=>{for(let G of j.callbacks)G(q)})};Q={callbacks:new Set,listener:Z},QJ.set(J,Q),J.addEventListener("scroll",Z,{passive:!0})}Q.callbacks.add($)}function e6(J,$){let Q=QJ.get(J);if(!Q)return;if(Q.callbacks.delete($),Q.callbacks.size===0)J.removeEventListener("scroll",Q.listener),QJ.delete(J)}class U0 extends t{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=U0._nextId++,this._scrubLag=typeof $.scrub==="number"?$.scrub:0}static _ensureLoadListener(){if(U0._loadListenerAdded||typeof window>"u")return;if(U0._loadListenerAdded=!0,document.readyState==="complete")return;window.addEventListener("load",()=>{setTimeout(()=>{for(let J of U0._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){let $=this._getFirstAnimatedElement()??this._resolveTriggerElement();if($ instanceof HTMLElement)J=$}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 Element)return Z}let $=this._timeline.getFirstChildAnimation();if($){let Q=$.getTargets();if(Q.length>0&&Q[0]instanceof Element)return Q[0]}return null}_resolveTriggerElement(){if(this._config.target instanceof Element)return this._config.target;if(typeof this._config.target==="string"&&typeof document<"u"){let J=document.querySelector(this._config.target);if(J instanceof Element)return J}return this._getFirstAnimatedElement()}_resolveEndTargetElement(){let J=this._config.endTarget;if(J instanceof Element)return J;if(typeof J==="string"&&J!==""&&typeof document<"u"){let $=document.querySelector(J);if($ instanceof Element)return $}return null}_calculateTriggerPositions(J){let Q=this._resolveTriggerElement()||J,Z=this._getViewportHeight(),j=this._getScrollTop();if(!Q){this._triggerStart=0,this._triggerEnd=this._getScrollHeight();return}let G=(!!J&&Q===J?this._pinManager?.getLayoutRect():null)??g(Q),z;if(this._scroller instanceof Element){let U=this._scroller.getBoundingClientRect();z=G.top-U.top+j}else z=G.top+j;let N=this._defaultStart().split(" "),K=N[0]||"top",Y=N[1]||"top",_=N0(K,G.height,Z),X=N0(Y,Z,Z);this._triggerStart=z+_-X;let B=this._defaultEnd();if(B.startsWith("+=")){let U=N0(B.slice(2),Z,Z);this._triggerEnd=this._triggerStart+U}else{let U=B.split(" "),W=U[0]||"bottom",O=U[1]||"top",F=this._resolveEndTargetElement(),A=F?g(F):G,L=z;if(F)if(this._scroller instanceof Element){let J0=this._scroller.getBoundingClientRect();L=A.top-J0.top+j}else L=A.top+j;let R=N0(W,A.height,Z),h=N0(O,Z,Z);this._triggerEnd=L+R-h}if(this._triggerEnd<=this._triggerStart)if(J)this._triggerEnd=this._triggerStart;else this._triggerEnd=this._triggerStart+Math.max(Z,100)}_onEnable(){this._resolveScroller();let J=this._resolvePinElement();this._calculateTriggerPositions(J),U0._activeInstances.add(this),U0._ensureLoadListener();let Q=(this._config.toggleActions||"play none none none").trim().split(/\s+/);if(this._toggleActions=[Q[0],Q[1],Q[2],Q[3]],J){let Z=g(J),j=this._getScrollTop(),G=(this._scroller instanceof Element?Z.top-this._scroller.getBoundingClientRect().top+j:Z.top+j)-this._triggerStart;this._pinManager=d.getOrCreate(this._id,J),this._pinManager.setup(J,this._triggerStart,this._triggerEnd,G,this._scroller===window,this._config.pinSpacing)}if(this._config.markers&&typeof document<"u"){let Z=this._pinManager?.getElement()||this._resolveTriggerElement();this._markerManager=new H6(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=(Z)=>this._onScroll(Z),this._scroller){if(t6(this._scroller,this._scrollListener),this._initializing=!0,this._onScroll(),this._initializing=!1,this._config.scrub===!1||this._config.scrub===void 0){if(this._triggerState==="active")m(this._toggleActions[0],this._timeline);else if(this._triggerState==="after")this._timeline.progress(1),this._timeline.pause()}}}_onDisable(){if(this._scrollListener&&this._scroller)e6(this._scroller,this._scrollListener),this._scrollListener=void 0;if(this._markerManager?.cleanup(),this._markerManager=null,this._pinManager){let J=this._pinManager.getElement();if(J)d.release(this._id,J);else this._pinManager.cleanup();this._pinManager=null}this._stopSmoothScrollLoop(),U0._activeInstances.delete(this)}refresh(){if(!this._enabled)return;let J=this._pinManager?.getElement()||null,$=this._pinManager?.suspendHtmlHeight?.()??null;if(this._calculateTriggerPositions(J),$?.(),this._pinManager&&J){let Q=this._pinManager.getLayoutRect()??g(J),Z=this._getScrollTop(),q=(this._scroller instanceof Element?Q.top-this._scroller.getBoundingClientRect().top+Z:Q.top+Z)-this._triggerStart;this._pinManager.setup(J,this._triggerStart,this._triggerEnd,q,this._scroller===window,this._config.pinSpacing)}if(this._markerManager)this._markerManager.recachePositions(this._getViewportHeight());this._timeline.invalidatePathGeometry(),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(J=this._getScrollTop()){if(!this._enabled)return;let $=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,e0(()=>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;e0(()=>{if(Z==="active"&&j==="before")m(this._toggleActions[0],this._timeline);else if(Z==="after"&&j==="active")m(this._toggleActions[1],this._timeline);else if(Z==="active"&&j==="after")m(this._toggleActions[2],this._timeline);else if(Z==="before"&&j==="active")m(this._toggleActions[3],this._timeline);else if(Z==="after"&&j==="before")m(this._toggleActions[0],this._timeline),this._timeline.progress(1),m(this._toggleActions[1],this._timeline);else if(Z==="before"&&j==="after")m(this._toggleActions[2],this._timeline),this._timeline.progress(0),m(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)},u.getInstance().add(this._scrubTickListener,U0._SCRUB_TICKER_PRIORITY)}_stopSmoothScrollLoop(){if(this._scrubTickListener)u.getInstance().remove(this._scrubTickListener),this._scrubTickListener=null}}D.registerTrigger("scroll",U0);class J7{_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()}}D.registerPageLoadTrigger(J7);class $7 extends t{_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;_pointerMoveHandler=null;_activeTarget=null;_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)u.getInstance().remove(this._tickerCallback),this._tickerCallback=void 0;if(this._frozenRects.clear(),this._activeTarget=null,this._pointerMoveHandler)K0(this._pointerMoveHandler),this._pointerMoveHandler=null;this._cleanupListenerMap(this._listeners)}_addViewportListeners(){if(typeof window>"u")return;this._pointerMoveHandler=(J)=>{this._handleViewportMouseMove(J.clientX,J.clientY)},G0(this._pointerMoveHandler),this._state.isInside=!0}refresh(){for(let J of this._targets)this._frozenRects.set(J,this._captureDocRect(J))}_scrollX(){if(typeof window>"u")return 0;return window.scrollX??window.pageXOffset??0}_scrollY(){if(typeof window>"u")return 0;return window.scrollY??window.pageYOffset??0}_captureDocRect(J){let $=g(J);return{left:$.left+this._scrollX(),top:$.top+this._scrollY(),width:$.width,height:$.height}}_viewportRect(J){let $=J.left-this._scrollX(),Q=J.top-this._scrollY();return{left:$,top:Q,right:$+J.width,bottom:Q+J.height,width:J.width,height:J.height}}_addTargetListeners(){for(let J of this._targets)this._frozenRects.set(J,this._captureDocRect(J));if(typeof window<"u"&&typeof window.requestAnimationFrame==="function"){this._pointerMoveHandler=(J)=>{this._handleTargetPointerMove(J.clientX,J.clientY)},G0(this._pointerMoveHandler);return}this._targets.forEach((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,$)})}_handleTargetPointerMove(J,$){let Q=this._findTargetAtPoint(J,$);if(!Q){if(this._state.isInside)this._state.isInside=!1,this._activeTarget=null,this._handleMouseLeave();return}this._state.isInside=!0,this._activeTarget=Q,this._handleTargetMouseMove(Q,J,$)}_findTargetAtPoint(J,$){for(let Q of this._targets){let Z=this._frozenRects.get(Q);if(!Z)continue;let j=this._viewportRect(Z);if(J>=j.left&&J<=j.right&&$>=j.top&&$<=j.bottom)return Q}return null}_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,H=Math.sqrt(G*G+z*z),N=Math.sqrt(j*j+q*q);this._targetState.targetDistance=1-Math.min(H/N,1)}this._applyProgress()}_handleTargetMouseMove(J,$,Q){let Z=this._frozenRects.get(J),j=Z?this._viewportRect(Z):J.getBoundingClientRect(),q=j.left+j.width/2,G=j.top+j.height/2;if(this._config.type==="axis"){let z=$-j.left,H=Q-j.top;this._targetState.targetX=Math.max(0,Math.min(1,z/j.width)),this._targetState.targetY=Math.max(0,Math.min(1,H/j.height))}else{let z=$-q,H=Q-G,N=Math.sqrt(z*z+H*H),K=Math.sqrt(Math.pow(j.width/2,2)+Math.pow(j.height/2,2));this._targetState.targetDistance=1-Math.min(N/K,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,H=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||!H)this._updateTimelineProgress()},u.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)}}D.registerTrigger("mouseMove",$7);class ZJ extends t{_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,{...$,types:$.types??[],events:$.events??{}});this._tolerance=this._config.tolerance??1,this._dragMinimum=this._config.dragMinimum??10,this._dragMinimumSquared=this._dragMinimum*this._dragMinimum,this._wheelSpeed=this._config.wheelSpeed??1,this._scrollSpeed=this._config.scrollSpeed??1,this._stopDelay=this._config.stopDelay??150,this._preventDefault=this._config.preventDefault??!1,this._lockAxis=this._config.lockAxis??!1,this._animationStep=this._config.animationStep??0.1,this._smooth=Math.max(0,Math.min(1,this._config.smooth??0));let Q=this._config;if(Q._siblings&&Q._index!==void 0){if(this._siblings=Q._siblings,this._index=Q._index,!ZJ._sequenceStates.has(this._siblings))ZJ._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)K0(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=g(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._fireEventImmediate("Hover");else if(!Z&&this._gestureHoverActive)this._gestureHoverActive=!1,this._fireEventImmediate("HoverEnd")},G0(this._boundHoverMoveHandler)}refresh(){if(this._target===window||!this._frozenHoverRect)return;this._frozenHoverRect=g(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()}_fireEventImmediate(J){let $=this._config.events?.[J];if($)this._executeAction($,J)}_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":m(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 $=ZJ._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()}}D.registerTrigger("gesture",ZJ);var DJ=null,kJ=null;function L9(J,$,Q,Z,j){if(j<=0)return`${J}${$}`;if(j>=1)return`${Q}${Z}`;let q=J*(1-j),G=Q*j,z=G<0?"-":"+";return`calc(${q}${$} ${z} ${Math.abs(G)}${Z})`}function Q7(J,$,Q,Z){let j=J;if(!j.style)return;let q=F0();if(V($))if(x(J,$,Q,Z),q)B0(J);else j.style.transform=C(J);else{let G=Z?`${Q}${Z}`:`${Q}`;if(q)k0(J,$,G);else try{if(p($))j.style.setProperty($,G);else if($ in j.style)j.style[$]=G;else j.style.setProperty(v($),G)}catch{}}}function Z7(J,$,Q,Z,j,q,G){let z=J;if(!z.style)return;let H=L9(Q,Z,j,q,G);if(F0())k0(J,$,H);else try{if(p($))z.style.setProperty($,H);else if($ in z.style)z.style[$]=H;else z.style.setProperty(v($),H)}catch{}}function j7(J,$,Q){let Z=J;if(!Z.style)return;if(F0())k0(J,$,Q);else try{if(p($))Z.style.setProperty($,Q);else if($ in Z.style)Z.style[$]=Q;else Z.style.setProperty(v($),Q)}catch{}}function q7(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(F0())k0(J,$,z);else try{if(p($))G.style.setProperty($,z);else if($ in G.style)G.style[$]=z;else G.style.setProperty(v($),z)}catch{}}function G7(J,$,Q,Z){let j=J;if(!j.style)return;if(DJ||(DJ=I.filter)){let q=DJ.interpolateFilters($,Q,Z),G=DJ.filterToString(q);if(F0())k0(J,"filter",G);else j.style.filter=G}}function z7(J,$,Q,Z,j){let q=J;if(!q.style)return;if(kJ||(kJ=I.clipPath)){let G=kJ.interpolateClipPaths(Q,Z,j),z=kJ.clipPathToString(G);if(F0())k0(J,"clip-path",z),k0(J,"-webkit-clip-path",z);else q.style.setProperty("clip-path",z),q.style.setProperty("-webkit-clip-path",z)}}function H7(J,$,Q){let{pathLUT:Z,alignOffset:j,pathOffset:q,pathRotate:G}=Q;if(!Z||Z.length===0)return;let z=$*(Z.length-1),H=Math.floor(z),N=Math.min(H+1,Z.length-1),K=z-H,Y=Z[H],_=Z[N],X=Y.x+(_.x-Y.x)*K,B=Y.y+(_.y-Y.y)*K,U=(q?.x??0)+X-(j?.x??0),W=(q?.y??0)+B-(j?.y??0);if(x(J,"x",U,"px"),x(J,"y",W,"px"),G){let O=M9(Y.angle,_.angle,K);x(J,"rotate",O,"deg")}if(F0())B0(J);else J.style.transform=C(J)}function M9(J,$,Q){let Z=$-J;if(Z>180)Z-=360;if(Z<-180)Z+=360;return J+Z*Q}var N6=null,N7=/^([-+]?[\d.]+(?:e[-+]?\d+)?)([a-z%]*)$/i;function D9(J,$,Q){if(Q<=0)return J;if(Q>=1)return $;let Z=J.trim().split(/\s+/),j=$.trim().split(/\s+/);if(Z.length!==j.length)return Q<0.5?J:$;let q=[];for(let G=0;G<Z.length;G++){if(Z[G]===j[G]){q.push(Z[G]);continue}let z=Z[G].match(N7),H=j[G].match(N7);if(!z||!H)return Q<0.5?J:$;let N=parseFloat(z[1]),K=z[2],Y=parseFloat(H[1]),_=H[2];if(K===_)q.push(`${N+(Y-N)*Q}${K}`);else{let X=N*(1-Q),B=Y*Q,U=B<0?"-":"+";q.push(`calc(${X}${K} ${U} ${Math.abs(B)}${_})`)}}return q.join(" ")}var k9=100,R9=500,b9=0.5,jJ=[],x9=50;function E9(J){for(let $=0;$<jJ.length;$++)if(jJ[$].length>=J){let Q=jJ.splice($,1)[0];return Q.length=J,Q}return Array(J)}function Y7(J){if(jJ.length<x9)jJ.push(J)}class Y6{target=null;property="";startValue=0;endValue=0;change=0;unit="";startUnit=null;endUnit=null;next=null;valueType="scalar";startString="";endString="";startColor=null;endColor=null;changeColor=new Float32Array(4);startFilters=null;endFilters=null;startDraw=null;endDraw=null;pathLength=0;startClipPath=null;endClipPath=null;pathData=null;motionPathLength=0;startProgress=0;endProgress=0;pathRotate=!1;alignOffset=null;pathOffset=null;pathLUT=null;pathAlignTarget=null;pathAlignAt=null;pathTarget=null;pathScaleX=1;pathScaleY=1;_isElement=!1;_pathGeomResolved=!1;init(J,$,Q,Z,j="",q,G){return this.target=J,this.property=$,this.startValue=Q,this.endValue=Z,this.change=Z-Q,this.unit=j,this.startUnit=q??null,this.endUnit=G??null,this.valueType="scalar",this._isElement=J instanceof Element,this}initString(J,$,Q,Z){return this.target=J,this.property=$,this.valueType="string",this.startString=Q,this.endString=Z,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}initClipPath(J,$,Q,Z){return this.target=J,this.property=$,this.valueType="clipPath",this.startClipPath=Q,this.endClipPath=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,H,N={x:1,y:1},K,Y,_){if(J instanceof Element)y(J,!0);return 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=H,this._isElement=J instanceof Element,this.pathAlignTarget=K??null,this.pathAlignAt=Y??[50,50],this.pathTarget=_??null,this._pathGeomResolved=!1,this._buildPathLUT(N?.x??1,N?.y??1),this}_buildPathLUT(J,$){let Q=this.pathData;if(!Q)return;let Z=this.startProgress,j=this.endProgress,q=this.pathRotate,G=Math.abs(j-Z),z=this.motionPathLength*G,H=Math.min(R9,Math.max(k9,Math.ceil(z*b9))),N=J!==1||$!==1;if(this.pathLUT)Y7(this.pathLUT),this.pathLUT=null;let K=E9(H+1);for(let Y=0;Y<=H;Y++){let _=Y/H,X=Z+(j-Z)*_,B=j6(Q,X,q);if(N)B.x*=J,B.y*=$;K[Y]=B}if(q&&N&&J!==$){let Y=K.length-1;for(let _=0;_<=Y;_++){let X=K[Math.max(0,_-1)],B=K[Math.min(Y,_+1)];K[_].angle=Math.atan2(B.y-X.y,B.x-X.x)*(180/Math.PI)}}this.pathLUT=K,this.pathScaleX=J,this.pathScaleY=$}_resolvePathGeometryIfNeeded(){if(this._pathGeomResolved)return;if(!this.pathAlignTarget||!(this.target instanceof Element)){this._pathGeomResolved=!0;return}let J=this.target,$=J.getBoundingClientRect();if($.width<=0||$.height<=0)return;let Q=AJ(this.pathTarget??"");if(this.alignOffset=FJ(J,this.pathAlignAt??[50,50]),this.pathOffset=LJ(this.pathAlignTarget,this.pathData??"",J,Q),Q.x!==this.pathScaleX||Q.y!==this.pathScaleY)this._buildPathLUT(Q.x,Q.y);this._pathGeomResolved=!0}invalidatePathGeometry(){if(this.valueType==="path")this._pathGeomResolved=!1}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)q7(this.target,this.property,$,Q,Z,j)}else if(this.valueType==="filter"&&this.startFilters&&this.endFilters){if(this._isElement)G7(this.target,this.startFilters,this.endFilters,J)}else if(this.valueType==="clipPath"&&this.startClipPath&&this.endClipPath){if(this._isElement)z7(this.target,this.property,this.startClipPath,this.endClipPath,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(N6||(N6=I.drawSVG))N6.applyDrawSVG(this.target,$,Q,this.pathLength)}}else if(this.valueType==="path"&&this.pathLUT&&this.pathLUT.length>0){if(this._isElement)this._resolvePathGeometryIfNeeded(),H7(this.target,J,{pathLUT:this.pathLUT,alignOffset:this.alignOffset??{x:0,y:0},pathOffset:this.pathOffset??{x:0,y:0},pathRotate:this.pathRotate})}else if(this.valueType==="string"){if(this._isElement){let $=this.startString===this.endString?this.endString:D9(this.startString,this.endString,J);j7(this.target,this.property,$)}}else{let $=this.startValue+this.change*J;if(this._isElement)if(this.startUnit&&this.endUnit&&this.startUnit!==this.endUnit)Z7(this.target,this.property,this.startValue,this.startUnit,this.endValue,this.endUnit,J);else Q7(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.startUnit=null,this.endUnit=null,this.next=null,this.valueType="scalar",this.startString="",this.endString="",this.startColor=null,this.endColor=null,this.startFilters=null,this.endFilters=null,this.startDraw=null,this.endDraw=null,this.pathLength=0,this.startClipPath=null,this.endClipPath=null,this.pathData=null,this.motionPathLength=0,this.startProgress=0,this.endProgress=0,this.pathRotate=!1,this.alignOffset=null,this.pathOffset=null,this.pathAlignTarget=null,this.pathAlignAt=null,this.pathTarget=null,this.pathScaleX=1,this.pathScaleY=1,this._pathGeomResolved=!1,this.pathLUT)Y7(this.pathLUT);this.pathLUT=null,this._isElement=!1}}class qJ{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 GJ=new qJ(()=>new Y6,500),b0={acquire:()=>GJ.acquire(),release:(J)=>GJ.release(J),getPoolSize:()=>GJ.getPoolSize(),getTotalCreated:()=>GJ.getTotalCreated(),clear:()=>GJ.clear()};var K7={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;_setVars;_duration=0.5;_delay=0;_ease="power1.out";_animation=null;_animations=[];_built=!1;_splitType;_mask;_repeat;_repeatDelay;_yoyo;_stagger;_axis;_fitConfig;_flapConfig;_onStart;_onUpdate;_onComplete;_onRepeat;_onReverseComplete;_skipInitialFromRender=!1;_plainObjectInitialValues=new Map;_expectedAnimationIds=[];_propsToAnimate=[];constructor(J,$){if(this._targets=YJ(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.flap){if(this._flapConfig=J.flap,!this._splitType)this._splitType="chars";else if(!this._splitType.includes("chars"))this._splitType="chars,"+this._splitType;if(this._stagger===void 0)this._stagger={each:0,from:"start"}}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)y(J),I.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(!I.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 z={};if(this._repeat!==void 0)z.repeat=this._repeat;if(this._repeatDelay!==void 0)z.repeatDelay=this._repeatDelay;if(this._yoyo)z.yoyo=this._yoyo;if(this._onStart)z.onStart=this._onStart;if(this._onUpdate)z.onUpdate=this._onUpdate;if(this._onComplete)z.onComplete=this._onComplete;if(this._onRepeat)z.onRepeat=this._onRepeat;if(this._onReverseComplete)z.onReverseComplete=this._onReverseComplete;if(this._stagger!==void 0)z.stagger=this._stagger;let H=[];for(let K of this._targets){if(!(K instanceof Element))continue;let Y=c._createAnimationCallback([K],{},this._duration,this._delay,this._ease,!1,void 0,z);if(Array.isArray(Y))H.push(...Y);else H.push(Y)}let N=this._fitConfig;for(let K of H)for(let Y of K.getTargets())if(Y instanceof Element)I.fit.registerPendingSetup(K,Y,N,b0);this._animation=H[0]??null,this._animations=H,this._expectedAnimationIds=H.map((K)=>K.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 z of Object.keys(Q))if(!(z in J))if(eJ(z))J[z]=Q[z];else if(z in K7)J[z]=K7[z];else if(z0(z))J[z]="";else if(o(z))J[z]="";else{let H=Q[z];if(H===void 0||H===null)continue;let K=S(H).unit||l(z),Y;for(let X of this._targets)if(X instanceof Element){if(p(z))try{let U=window.getComputedStyle(X).getPropertyValue(z).trim();if(U)Y=S(U).value}catch{}else Y=d0(X,z,K);break}let _=Y??0;J[z]=K?`${_}${K}`:`${_}`}}else if(this._fromVars)J={...this._fromVars},$=!0;else if(this._toVars)J={...this._toVars};if(this._splitType&&I.textSplitter?.split){let z={mask:!!this._mask,consumer:this},H=[];for(let N of this._originalTargets)if(N instanceof Element){let K=I.textSplitter?.split(N,this._splitType,z);H.push(...K)}if(H.length>0)this._targets=H}let Z,j;if(this._flapConfig&&I.textFlapper?.prepare&&c._createAnimationCallback){if(Q&&Object.keys(Q).length>0){let H=[];for(let N of Object.keys(Q)){let K=Q[N],Y=J[N];if(K===void 0||Y===void 0)continue;if(z0(N)||o(N)||p(N))continue;if(N==="drawSVG"||N==="path"||N==="clip-path"||N==="clipPath")continue;let _=S(K),X=S(Y),B=_.unit||X.unit||l(N);H.push({prop:N,from:_.value,to:X.value,unit:B,isTransform:V(N)})}if(H.length>0)j=H}let z=this._targets.filter((H)=>H instanceof HTMLElement);if(z.length>0){let H=this._repeat!==void 0&&this._repeat!==0,N=I.textFlapper.prepare(z,this._flapConfig,H,j),K=this._stagger&&I.stagger?I.stagger.resolve(z,this._stagger):void 0;Z=[];let Y=0;for(let _=0;_<z.length;_++){let X=z[_].textContent??"";if(X===""||X===" "||X===" "||X===`
34
+ `||X==="\t")continue;if(Y>=N.length)break;let U=N[Y],W=K?K[_]:0,O=c._createAnimationCallback([U.el],{},this._duration,W,this._ease??"power1.out",!1,void 0,{onUpdate:U.render,onComplete:U.finalize,repeat:H?Math.ceil(60/this._duration):0,_skipInitialRender:this._skipInitialFromRender||void 0}),F=Array.isArray(O)?O:[O];Z.push(...F),Y++}}}if(Z?.length&&this._flapConfig){let z=this._flapConfig.type??"flip",H=new Set(j?.map((_)=>_.prop)??[]),N=(_)=>{if(H.has(_))return!0;switch(z){case"fade":return _==="opacity";case"blur":return o(_);default:return!1}},K=[];for(let _ of Object.keys(J))if(N(_))K.push(_),delete J[_];if(Q){for(let _ of Object.keys(Q))if(N(_)&&!K.includes(_))K.push(_),delete Q[_]}let Y=K.filter((_)=>!H.has(_));if(Y.length>0)console.warn(`[Motion.page] Flap type '${z}' owns '${Y.join(", ")}' — user-defined values for these properties were removed. Use a different flap type to avoid this conflict.`)}if(this._propsToAnimate=Object.keys(J),Q){for(let z of Object.keys(Q))if(!this._propsToAnimate.includes(z))this._propsToAnimate.push(z)}if(this._plainObjectInitialValues.size===0)this._capturePlainObjectValues(this._propsToAnimate);if($){for(let z of this._targets)if(z instanceof Element)y(z),I.styleReset?.clearAnimationStylesForProps?.(z,this._propsToAnimate)}if(I.styleReset?.registerAnimatedProps){for(let z of this._targets)if(z instanceof Element)I.styleReset?.registerAnimatedProps(z,this._propsToAnimate)}let q={repeat:this._repeat,repeatDelay:this._repeatDelay,yoyo:this._yoyo,stagger:this._stagger,onStart:this._onStart,onUpdate:this._onUpdate,onComplete:this._onComplete,onRepeat:this._onRepeat,onReverseComplete:this._onReverseComplete,_skipInitialRender:this._skipInitialFromRender||void 0};if(!c._createAnimationCallback)throw Error("AnimationBuilder: Engine not initialized. Call AnimationBuilder.setCreateAnimationCallback first.");if(Object.keys(J).length>0||Q&&Object.keys(Q).length>0||!Z?.length){let z=c._createAnimationCallback(this._targets,J,this._duration,this._delay,this._ease,$,Q,q);if(Array.isArray(z))this._animations=z,this._animation=z[0]||null;else this._animation=z,this._animations=[z]}if(Z&&Z.length>0){if(this._animations.push(...Z),!this._animation)this._animation=Z[0]}if(this._expectedAnimationIds=this._animations.map((z)=>z.getId()),this._setVars&&Object.keys(this._setVars).length>0&&c._createAnimationCallback){let z=c._createAnimationCallback(this._targets,{...this._setVars},0,0,"none",!1,void 0,{_skipInitialRender:this._skipInitialFromRender||void 0}),H=Array.isArray(z)?z:[z];this._animations=[...H,...this._animations],this._expectedAnimationIds=this._animations.map((N)=>N.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}hasFlap(){return!!this._flapConfig}_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,flap:this._flapConfig?{...this._flapConfig}: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 RJ{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`),$}}var V9=0.000001;class P{static _eachCounter=0;static _registerWithEngine=null;static _activateEngine=null;static setEngineRegisterCallback(J){P._registerWithEngine=J}static setEngineActivationCallback(J){P._activateEngine=J}_name;_children=[];_initialRenderStartTimes=null;_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}_notifyActivated(){P._activateEngine?.()}_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&&P._registerWithEngine)P._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._initialRenderStartTimes=null,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(V(Z)||h0(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(z0(Z)||o(Z))q.set(Z,{removeInline:!0});else if(A0(Z))q.set(Z,{removeInline:!0});else{let z=Z.replace(/([A-Z])/g,"-$1").toLowerCase();if(G.style.getPropertyValue(z)!==""){let N=J6(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;y(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(V(Z))continue;if(A0(Z)){Q.style.removeProperty("stroke-dasharray"),Q.style.removeProperty("stroke-dashoffset");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=RJ.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;this._initialRenderStartTimes=null;let Z=$;for(let j of Q){let q=j.getDelay(),G=$+q;j.clearDelay();let z=j.totalDuration(),H={type:"animation",child:j,builder:J,startTime:G,duration:z};this._children.push(H),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(J.hasSplit()){for(let Y of J.getOriginalTargets())if(Y instanceof Element){let _=Y;if(!this._splitParentOverrides.has(_))this._splitParentOverrides.set(_,_.style.opacity);_.style.opacity="1"}}let K=G+z;if(K>Z)Z=K}if(this._previousStart=$,this._previousEnd=Z,Z>this._duration)this._duration=Z;if(!this._isActive&&this._time===0)this._renderInitialTimelineState();return this}_getInitialRenderStartTimes(){if(this._initialRenderStartTimes)return this._initialRenderStartTimes;let J=new Map;for(let $ of this._children){if($.type!=="animation")continue;let Q=$.child;if(Q.isLazyCapture())continue;let Z=Q.getFirstPropTween();while(Z){let j=Z.target;if(j){let q=J.get(j);if(!q)q=new Map,J.set(j,q);let G=q.get(Z.property);if(G===void 0||$.startTime<G)q.set(Z.property,$.startTime)}Z=Z.next}}return this._initialRenderStartTimes=J,J}_renderAnimationInitialBoundary(J,$){let Q=this._getInitialRenderStartTimes();$.renderAtTime(0,(Z)=>{let j=Z.target;if(!j)return!1;let G=Q.get(j)?.get(Z.property);return G!==void 0&&Math.abs(G-J.startTime)<V9})}_renderInitialTimelineState(){this._restoreInitialValues(),this._renderPositionZeroAnimations(),this._atZeroState=!0}call(J,$,Q){let Z=RJ.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(P0(j))return j}let $=this.getFirstChildAnimation();if($){let Q=$.getTargets();for(let Z of Q)if(P0(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(P0(q)&&!$.has(q))$.add(q),J.push(q)}return J}_createInstanceForElement(J,$){let Z=`${this._name||"__each"}__each_${$}_${P._eachCounter++}`,j=new P(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((_)=>P0(_)).includes(J))continue;let H=G.builder.getConfig(),N=H.repeat!=null?{times:H.repeat,delay:H.repeatDelay,yoyo:H.yoyo}:void 0,K=G.builder.hasSplit(),Y=new c(J,{from:H.fromVars,to:H.toVars,set:H.setVars,duration:H.duration,delay:H.delay,ease:H.ease,repeat:N,...K&&H.split?{split:H.split}:{},...K&&H.mask?{mask:H.mask}:{},...K&&H.stagger!==void 0?{stagger:H.stagger}:{},...H.flap?{flap:H.flap}:{},...H.fit?{fit:H.fit}:{},onStart:H.onStart,onUpdate:H.onUpdate,onComplete:H.onComplete,onRepeat:H.onRepeat,onReverseComplete:H.onReverseComplete});if(H.axis)Y.setAxis(H.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_${$}_${P._eachCounter++}`,j=new P(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(),H=(G.builder.hasSplit()?G.builder.getOriginalTargets():G.builder.getTargets()).filter((X)=>P0(X)),N=J.filter((X)=>H.includes(X));if(N.length===0)continue;let K=z.repeat!=null?{times:z.repeat,delay:z.repeatDelay,yoyo:z.yoyo}:void 0,Y=G.builder.hasSplit(),_=new c(N,{from:z.fromVars,to:z.toVars,set:z.setVars,duration:z.duration,delay:z.delay,ease:z.ease,repeat:K,...Y&&z.split?{split:z.split}:{},...Y&&z.mask?{mask:z.mask}:{},...(Y||N.length>1)&&z.stagger!==void 0?{stagger:z.stagger}:{},...z.flap?{flap:z.flap}:{},...z.fit?{fit:z.fit}:{},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}_findScopedTargetsForContainer(J,$,Q){let Z=$.filter((q)=>J.contains(q));if(Z.length>0)return Z;let j=J.parentElement;if(j){let q=$.filter((G)=>G!==J&&j.contains(G)&&!Q.some((z)=>z!==J&&z.contains(G)));if(q.length>0)return q}return[]}_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=new Set(this._children.filter((Z)=>Z.type==="animation"&&Z.builder?.hasSplit()).map((Z)=>Z.builder));if(Q.size>0)for(let Z of J)for(let j of Q)I.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;for(let j of this._eachInstances)j.onUpdate((q,G)=>{let z=q>0&&q<1;if(z)Z=j;if(Z===j){if(this._onUpdate?.(q,G),!z)Z=null}}),j.onStart(()=>{Z=j,this._onStart?.()}),j.onComplete(()=>{if(Z===j)Z=null,this._onComplete?.()})}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=I.triggerManager?.getInstance?.();if(!Q)return;let{each:Z,...j}=$;if($.target){let G=this._resolveTargetElements($.target);if(G.length===0){if(J==="scroll"){let Y=this._getAllAnimationTargets();if(Y.length===0)return;this._setupEachModeGeneric(Y,(_,X)=>{Q.registerScroll(_,{...j,target:X})})}else if(typeof console<"u")console.warn(`[Motion] onScroll/onHover/onClick each-mode target "${String($.target)}" matched no elements — ${J} trigger not registered.`);return}let z=this._getAllAnimationTargets(),H=new Set;for(let Y of G){let _=z.filter((B)=>Y.contains(B));if(_.length>0){for(let B of _)H.add(B);continue}let X=Y.parentElement;if(X){let B=z.filter((U)=>U!==Y&&X.contains(U)&&!G.some((W)=>W!==Y&&W.contains(U)));for(let U of B)H.add(U)}}if(!z.every((Y)=>H.has(Y))&&J==="scroll"){let Y=new Set(this._children.filter((_)=>_.type==="animation"&&_.builder?.hasSplit()).map((_)=>_.builder));if(Y.size>0)for(let _ of z)for(let X of Y)I.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 K=new Set(this._children.filter((Y)=>Y.type==="animation"&&Y.builder?.hasSplit()).map((Y)=>Y.builder));if(K.size>0)for(let Y of z)for(let _ of K)I.textSplitter?.revert?.(Y,_);this._clearTransitionData(),this._eachInstances=[];for(let Y=0;Y<G.length;Y++){let _=G[Y],X=this._findScopedTargetsForContainer(_,z,G);if(X.length===0)continue;let B=this._createInstanceForElements(X,Y);if(J==="scroll")Q.registerScroll(B,{...j,target:_});else if(J==="hover")Q.registerHover(B,{...j,target:_});else Q.registerClick(B,{...j,target:_});this._eachInstances.push(B)}{let Y=null,_=this._onUpdate,X=this._onStart,B=this._onComplete;for(let U of this._eachInstances){if(_)U.onUpdate((W,O)=>{let F=W>0&&W<1;if(F)Y=U;if(Y===U){if(_(W,O),!F)Y=null}});if(X)U.onStart(()=>{Y=U,X()});if(B)U.onComplete(()=>{if(Y===U)Y=null,B()})}}this._eachDuration=this._duration;for(let Y of this._children)if(Y.type==="animation"){let _=Y.child;_.setTimelineChild(!1),_.kill()}else if(Y.type==="timeline")Y.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 I.triggerManager?.getInstance?.().registerHover(this,{target:$,onEnter:J?.onEnter,onLeave:J?.onLeave,leaveDelay:J?.leaveDelay}),this}onClick(J){if(J?.each)return this._setupEachMode("click",J),this;let $=J?.target??this._getFirstAnimationTarget();return I.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 I.triggerManager?.getInstance?.().registerScroll(this,{...J,target:$}),this}onMouseMove(J){if(J?.each&&J.target)return this._setupMouseMoveEachMode(J),this;return I.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=I.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 I.triggerManager?.getInstance?.().registerPageLoad(this,J||{}),this}onPageExit(J){return I.triggerManager?.getInstance?.().registerPageExit(this,J||{}),this}onGesture(J){if(J.each)return this._setupGestureEachMode(J),this;return I.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=I.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 I.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,H=J.params||[];z(...H)}}_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())this._renderAnimationInitialBoundary(J,Q);if(Q.isActive())Q.pause(),Q.fireReverseComplete()}else if(Q.isActive())Q.renderAtTime(Q.totalDuration()),Q.pause();else if($===0){if(Q.needsStartCapture())Q.captureStartValues();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{let j=this._time-this._duration;this._time=Math.max(0,j),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._notifyActivated(),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._notifyActivated(),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._notifyActivated(),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())this._renderAnimationInitialBoundary(J,$);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}if(this._time=Math.max(0,Math.min(J,this._duration)),this._progress=this._duration>0?this._time/this._duration:0,this._atZeroState=!1,this._repeat!==0){for(let $ of this._children)if($.type==="animation")$.child.resetForReplay()}return 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._atZeroState=this._time===0?this._atZeroState:!1,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,I.triggerManager?.getInstance?.().unregister(this),this._eachInstances){for(let Q of this._eachInstances)Q.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,Z]of this._splitParentOverrides)if(Z)Q.style.opacity=Z;else Q.style.removeProperty("opacity");this._splitParentOverrides.clear()}let $=new Set(this._children.filter((Q)=>Q.type==="animation"&&Q.builder?.hasSplit()).map((Q)=>Q.builder));if($.size>0){for(let Q of $)for(let Z of Q.getOriginalTargets())if(Z instanceof Element)I.textSplitter?.revert?.(Z,Q)}for(let Q of this._children)if(Q.type==="animation"){let Z=Q.child;Z.setTimelineChild(!1),Z.kill()}else if(Q.type==="timeline")Q.child.kill(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}invalidatePathGeometry(){for(let J of this._children)if(J.type==="animation")J.child.invalidatePathGeometry();else if(J.type==="timeline")J.child.invalidatePathGeometry()}getFirstChildBuilder(){let J=this._children[0];if(J?.type==="animation"&&J.builder)return J.builder;return null}}function bJ(J,$,Q){let Z=J;if(V($)){let G=Q??($.startsWith("scale")?"":"px");return(z)=>{x(J,$,z,G),Z.style.transform=C(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 w9=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 C9(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 m0 extends t{_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;_pointerMoveTarget=null;_hoverSelectors=null;_isHoveringCursorTarget=!1;_boundHoverTargetMoveHandler=null;_hoverPointerMoveTarget=null;_boundTextAttributeMoveHandler=null;_textPointerMoveTarget=null;_activeTextAttributeElement=null;_hasTextAttributeElements=!1;_textAttributeObserver=null;_textAttributeObserverActive=!1;_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),x(this._innerElement,"x",-50,"%"),x(this._innerElement,"y",-50,"%"),this._xSetter=bJ(this._element,"x","px"),this._ySetter=bJ(this._element,"y","px"),this._config.squeeze)this._squeezeSetter=bJ(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=C(this._innerElement),this._config.hideNative)this._cursorStyleTag=document.createElement("style"),this._cursorStyleTag.setAttribute("data-cursor-hide",""),this._cursorStyleTag.textContent="html { cursor: none; }",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),u.getInstance().add(this._tickerCallback)}_onDisable(){if(this._tickerCallback)u.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=m0._expandTransformShorthand(String(Q));for(let[j,q]of Object.entries(Z))x(this._innerElement,j,q)}else if(V($)){let Z=typeof Q==="number"?{value:Q,unit:l($)}:S(Q);x(this._innerElement,$,Z.value,Z.unit||l($)||void 0)}else{let Z=v($),j=typeof Q==="number"&&!w9.has(Z)?`${Q}px`:String(Q);(Z==="mix-blend-mode"&&this._element?this._element:this._innerElement).style.setProperty(Z,j)}}_createStateTimelines(){if(!this._innerElement)return;let J=this._parsedStates.get("hover");if(J&&J.enabled){let Q=new P;Q._addEntry(this._innerElement,{to:m0._expandStateProperties(J.properties),duration:J.duration,ease:J.ease}),this._stateTimelines.set("hover",Q)}let $=this._parsedStates.get("click");if($&&$.enabled){let Q=new P;Q._addEntry(this._innerElement,{to:m0._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=m0._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},this._pointerMoveTarget=typeof document<"u"?document:typeof window<"u"?window:null,G0(this._boundMouseMove,this._pointerMoveTarget),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)this._isHoveringCursorTarget=!1,this._releaseHoverIfInactive()},this._hoverPointerMoveTarget=typeof window<"u"?window:null,G0(this._boundHoverTargetMoveHandler,this._hoverPointerMoveTarget)}_setupTextCursor(){if(!this._innerElement)return;this._innerElement.style.display="grid",this._innerElement.style.placeItems="center",this._innerElement.style.overflow="visible",this._textElement=document.createElement("div"),this._textElement.setAttribute("data-cursor-text",""),this._textElement.style.whiteSpace="nowrap",this._textElement.style.opacity="0",this._innerElement.appendChild(this._textElement);let $=this._parsedStates.get("hover")?.duration??0.15;if(this._textElement.style.transition=`opacity ${$}s ease-in-out`,this._config.text)for(let[Q,Z]of Object.entries(this._config.text))this._textElement.style.setProperty(v(Q),String(Z));this._setupTextAttributeHitTesting()}_setupTextAttributeHitTesting(){this._updateHasTextAttributeElements(),this._observeTextAttributeElements(),this._boundTextAttributeMoveHandler=(J)=>{if(this._textAttributeObserverActive&&!this._hasTextAttributeElements){if(this._activeTextAttributeElement)this._activeTextAttributeElement=null,this._hideTextCursor();return}let $=this._findTextAttributeTarget(J);if($){this._activeTextAttributeElement=$,this._showTextCursor($);return}if(this._activeTextAttributeElement)this._activeTextAttributeElement=null,this._hideTextCursor()},this._textPointerMoveTarget=typeof document<"u"?document:typeof window<"u"?window:null,G0(this._boundTextAttributeMoveHandler,this._textPointerMoveTarget)}_updateHasTextAttributeElements(){if(typeof document>"u"||typeof document.querySelector!=="function"){this._hasTextAttributeElements=!1;return}try{this._hasTextAttributeElements=document.querySelector("[mp-cursor-text], [mp-cursor-tooltip]")!==null}catch{this._hasTextAttributeElements=!1}}_observeTextAttributeElements(){if(typeof document>"u"||typeof MutationObserver!=="function")return;let J=document.body??document.documentElement;if(!J)return;try{let $=new MutationObserver(()=>{this._updateHasTextAttributeElements()});$.observe(J,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["mp-cursor-text","mp-cursor-tooltip"]}),this._textAttributeObserver=$,this._textAttributeObserverActive=!0}catch{this._textAttributeObserver=null,this._textAttributeObserverActive=!1}}_findTextAttributeTarget(J){let Q=(Z)=>{let j=Z;if(!j||typeof j.getAttribute!=="function")return null;if(j.getAttribute("mp-cursor-text")!==null||j.getAttribute("mp-cursor-tooltip")!==null)return j;if(typeof j.closest==="function")try{return j.closest("[mp-cursor-text], [mp-cursor-tooltip]")}catch{return null}return null};if(typeof document<"u"&&typeof document.elementsFromPoint==="function")for(let Z of document.elementsFromPoint(J.clientX,J.clientY)){let j=Q(Z);if(j)return j}return Q(J.target)}_showTextCursor(J){let $=J.getAttribute("mp-cursor-text")??J.getAttribute("mp-cursor-tooltip")??"";if(this._textElement)this._textElement.textContent=$,this._textElement.style.opacity="1";this._setState("hover")}_releaseHoverIfInactive(){if(this._isHoveringCursorTarget)return;if(this._activeTextAttributeElement)return;if(this._state==="hover")this._setState("default")}_hideTextCursor(){if(this._textElement)this._textElement.style.opacity="0";this._releaseHoverIfInactive()}_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(v(Z),String(j)),$.style.setProperty(v(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||!C9(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)K0(this._boundMouseMove,this._pointerMoveTarget),this._boundMouseMove=void 0,this._pointerMoveTarget=null;if(this._boundMouseDown)document.removeEventListener("mousedown",this._boundMouseDown);if(this._boundMouseUp)document.removeEventListener("mouseup",this._boundMouseUp);if(this._boundHoverTargetMoveHandler)K0(this._boundHoverTargetMoveHandler,this._hoverPointerMoveTarget),this._boundHoverTargetMoveHandler=null,this._hoverPointerMoveTarget=null;if(this._hoverSelectors=null,this._isHoveringCursorTarget=!1,this._boundTextAttributeMoveHandler)K0(this._boundTextAttributeMoveHandler,this._textPointerMoveTarget),this._boundTextAttributeMoveHandler=null,this._textPointerMoveTarget=null;if(this._textAttributeObserver)this._textAttributeObserver.disconnect(),this._textAttributeObserver=null;this._textAttributeObserverActive=!1,this._hasTextAttributeElements=!1,this._activeTextAttributeElement=null,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}}D.registerTrigger("cursor",m0);class X7 extends t{_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}}D.registerTrigger("pageExit",X7);var K6=null;function S9(){if(!K6&&typeof document<"u"){let J=document.createElement("canvas");J.width=1,J.height=1,K6=J.getContext("2d")}return K6}function B7(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 P9(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 y9(J,$,Q){J=J/360,$=$/100,Q=Q/100;let Z,j,q;if($===0)Z=j=q=Q;else{let G=(N,K,Y)=>{if(Y<0)Y+=1;if(Y>1)Y-=1;if(Y<0.16666666666666666)return N+(K-N)*6*Y;if(Y<0.5)return K;if(Y<0.6666666666666666)return N+(K-N)*(0.6666666666666666-Y)*6;return N},z=Q<0.5?Q*(1+$):Q+$-Q*$,H=2*Q-z;Z=G(H,z,J+0.3333333333333333),j=G(H,z,J),q=G(H,z,J-0.3333333333333333)}return[Math.round(Z*255),Math.round(j*255),Math.round(q*255)]}function v9(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,H]=y9(Q,Z,j);return new Float32Array([G,z,H,q])}function T9(J,$){if(!$||typeof window>"u")return null;let Q=J.trim(),j=(/^--[\w-]+$/.test(Q)?`var(${Q})`:Q).match(/var\s*\(\s*(--[\w-]+)\s*(?:,\s*(.+))?\s*\)\s*$/i);if(!j)return null;let q=j[1],G=window.getComputedStyle($).getPropertyValue(q).trim();if(G)return xJ(G,$);let z=j[2]?.trim();if(z)return xJ(z,$);return null}function h9(J){let $=S9();if(!$)return null;$.fillStyle="#000000",$.fillStyle=J;let Q=$.fillStyle;if(Q==="#000000"&&J.toLowerCase()!=="black"&&J!=="#000000"&&J!=="#000")return null;return B7(Q)}function xJ(J,$){if(!J||typeof J!=="string")return null;let Q=J.trim(),Z=Q.toLowerCase();if(Z==="transparent")return new Float32Array([0,0,0,0]);if(Q.startsWith("#"))return B7(Q);if(Z.startsWith("rgb"))return P9(Q);if(Z.startsWith("hsl"))return v9(Q);if(/^var\s*\(/i.test(Q)||/^--[\w-]+$/.test(Q))return T9(Q,$);return h9(Z)}function f9(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 xJ(j,J)||new Float32Array([0,0,0,1])}I.color={parseColor:xJ,getCurrentColor:f9};var _7={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 u9(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 W7(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=u9(j[0]);if(q)Q.push(q)}return Q.length>0?Q:null}function d9(J){let $=_7[J.name];if(!$)return!1;return J.value===$.value}function c9(J){if(!J||J.length===0)return"none";if(J.every(d9))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 m9(J){if(typeof window>"u")return[];let $=window.getComputedStyle(J),Q=$.filter||$.getPropertyValue("filter");if(!Q||Q==="none")return[];return W7(Q)||[]}function p9(J){let $=_7[J];if($)return{name:J,value:$.value,unit:$.unit};return{name:J,value:0,unit:""}}function g9(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),H=p9(q);Z.push(G||H),j.push(z||H)}return{start:Z,end:j}}var p0=[];function o9(J,$,Q){let Z=J.length;if(p0.length<Z)for(let j=p0.length;j<Z;j++)p0.push({name:"",value:0,unit:""});for(let j=0;j<Z;j++){let q=J[j],G=$[j],z=p0[j];z.name=q.name,z.value=q.value+(G.value-q.value)*Q,z.unit=q.unit||G.unit}return p0.length=Z,p0}I.filter={parseFilter:W7,getCurrentFilter:m9,mergeFilterArrays:g9,interpolateFilters:o9,filterToString:c9};var U7=new WeakMap;function l9(J){return"getTotalLength"in J&&typeof J.getTotalLength==="function"}function EJ(J){let $=U7.get(J);if($!==void 0)return $;if(l9(J)){let Q=J.getTotalLength();return U7.set(J,Q),Q}return 0}function s9(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]),H=Z[4]||"%",N=$?EJ($):0,K=X6(q,G,N),Y=X6(z,H,N);return{start:K,end:Y}}let j=Q.match(/^([-\d.]+)(px|%)?$/);if(j){let q=parseFloat(j[1]),G=j[2]||"%",z=$?EJ($):0;return{start:0,end:X6(q,G,z)}}}return null}function X6(J,$,Q){if($==="px"&&Q>0)return J/Q;return J/100}function i9(J){let $=EJ(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],H=-G/$,N=(-G+z)/$;return{start:H,end:N}}}}catch{}return{start:0,end:1}}function n9(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}`}I.drawSVG={parseDrawSVG:s9,getCurrentDrawSVG:i9,getPathLength:EJ,applyDrawSVG:n9};var O7=/(-?\d*\.?\d+)([a-z%]*)/gi;function I7(J){O7.lastIndex=0;let $=O7.exec(J);if(!$)return null;let Q=parseFloat($[1]);if(!isFinite(Q))return null;return{value:Q,unit:$[2]||""}}function x0(J){let $=[],Q=/(-?\d*\.?\d+)([a-z%]*)/gi,Z;while((Z=Q.exec(J))!==null){let j=parseFloat(Z[1]);if(!isFinite(j))continue;$.push({value:j,unit:Z[2]||""})}return $}function F7(J){if(J===null||J===void 0||typeof J!=="string")return null;let $=J.trim();if($===""||$==="none")return null;let Q=$.match(/^([a-z-]+)\s*\(\s*([\s\S]*)\s*\)\s*$/i);if(!Q)return null;let Z=Q[1].toLowerCase(),j=Q[2];switch(Z){case"circle":return a9(j);case"ellipse":return r9(j);case"inset":return t9(j);case"polygon":return e9(j);case"rect":return J$(j);case"xywh":return $$(j);default:return null}}function a9(J){let[$,Q]=A7(J),Z=I7($)??{value:50,unit:"%"},[j,q]=L7(Q);return{shape:"circle",components:[Z,j,q]}}function r9(J){let[$,Q]=A7(J),Z=x0($),j=Z[0]??{value:50,unit:"%"},q=Z[1]??j,[G,z]=L7(Q);return{shape:"ellipse",components:[j,q,G,z]}}function t9(J){let{mainPart:$,roundPart:Q}=B6(J),Z=x0($),j=Z[0]??{value:0,unit:"px"},q=Z[1]??j,G=Z[2]??j,z=Z[3]??q,H=[j,q,G,z];if(Q!==null){let N=x0(Q);if(N.length===0)H.push({value:0,unit:"px"});else for(let K of N)H.push(K)}return{shape:"inset",components:H,extras:Q!==null?{hasRound:!0}:void 0}}function e9(J){let $=[],Z=J.replace(/^(nonzero|evenodd)\s*,\s*/i,"").split(",");for(let j of Z){let q=x0(j);if(q.length>=2)$.push(q[0],q[1])}return{shape:"polygon",components:$}}function J$(J){let{mainPart:$,roundPart:Q}=B6(J),Z=x0($),j=Z[0]??{value:0,unit:"px"},q=Z[1]??j,G=Z[2]??j,z=Z[3]??q,H=[j,q,G,z];if(Q!==null){let N=x0(Q);if(N.length===0)H.push({value:0,unit:"px"});else for(let K of N)H.push(K)}return{shape:"rect",components:H,extras:Q!==null?{hasRound:!0}:void 0}}function $$(J){let{mainPart:$,roundPart:Q}=B6(J),Z=x0($),j=Z[0]??{value:0,unit:"px"},q=Z[1]??{value:0,unit:"px"},G=Z[2]??{value:0,unit:"px"},z=Z[3]??{value:0,unit:"px"},H=[j,q,G,z];if(Q!==null){let N=x0(Q);if(N.length===0)H.push({value:0,unit:"px"});else for(let K of N)H.push(K)}return{shape:"xywh",components:H,extras:Q!==null?{hasRound:!0}:void 0}}function A7(J){let $=J.toLowerCase().search(/\bat\b/);if($===-1)return[J.trim(),""];return[J.slice(0,$).trim(),J.slice($+2).trim()]}function B6(J){let $=J.toLowerCase().search(/\bround\b/);if($===-1)return{mainPart:J.trim(),roundPart:null};return{mainPart:J.slice(0,$).trim(),roundPart:J.slice($+5).trim()}}function L7(J){let $=[{value:50,unit:"%"},{value:50,unit:"%"}];if(!J)return $;let Q=J.trim().split(/\s+/),Z=[];for(let G of Q){let z=I7(G);if(z){Z.push(z);continue}let H=G.toLowerCase();if(H==="center")Z.push({value:50,unit:"%"});else if(H==="left"||H==="top")Z.push({value:0,unit:"%"});else if(H==="right"||H==="bottom")Z.push({value:100,unit:"%"})}let j=Z[0]??$[0],q=Z[1]??$[1];return[j,q]}function Q$(J){if(typeof window>"u")return null;try{let $=window.getComputedStyle(J),Q=$.clipPath||$.getPropertyValue("clip-path")||$.getPropertyValue("-webkit-clip-path");if(!Q||Q==="none")return null;return F7(Q)}catch{return null}}function M7(J,$){if(J.shape!==$.shape)return!1;if(J.components.length!==$.components.length)return!1;return!0}var g0=[];function Z$(J,$,Q){if(!M7(J,$))return Q>=0.5?$:J;let Z=J.components.length;if(g0.length<Z)for(let j=g0.length;j<Z;j++)g0.push({value:0,unit:""});g0.length=Z;for(let j=0;j<Z;j++){let q=J.components[j],G=$.components[j],z=g0[j];z.value=q.value+(G.value-q.value)*Q,z.unit=G.unit||q.unit}return{shape:$.shape,components:g0,extras:$.extras??J.extras}}function b(J){return`${Math.round(J.value*1e4)/1e4}${J.unit}`}function j$(J){let $=J.components;switch(J.shape){case"circle":return`circle(${b($[0])} at ${b($[1])} ${b($[2])})`;case"ellipse":return`ellipse(${b($[0])} ${b($[1])} at ${b($[2])} ${b($[3])})`;case"inset":{let Q=`${b($[0])} ${b($[1])} ${b($[2])} ${b($[3])}`;if(J.extras?.hasRound&&$.length>4){let Z=$.slice(4).map(b).join(" ");return`inset(${Q} round ${Z})`}return`inset(${Q})`}case"polygon":{let Q=[];for(let Z=0;Z<$.length;Z+=2)Q.push(`${b($[Z])} ${b($[Z+1])}`);return`polygon(${Q.join(", ")})`}case"rect":{let Q=`${b($[0])} ${b($[1])} ${b($[2])} ${b($[3])}`;if(J.extras?.hasRound&&$.length>4){let Z=$.slice(4).map(b).join(" ");return`rect(${Q} round ${Z})`}return`rect(${Q})`}case"xywh":{let Q=`${b($[0])} ${b($[1])} ${b($[2])} ${b($[3])}`;if(J.extras?.hasRound&&$.length>4){let Z=$.slice(4).map(b).join(" ");return`xywh(${Q} round ${Z})`}return`xywh(${Q})`}}}I.clipPath={parseClipPath:F7,getCurrentClipPath:Q$,interpolateClipPaths:Z$,clipPathToString:j$,canInterpolate:M7};var S0=new WeakMap;function k7(J,$,Q,Z){let q=(J.getAttribute("data-split")??"").split(",").map((X)=>X.trim()),G=Q.split(",").map((X)=>X.trim()),z=G.includes("chars"),H=G.includes("words"),N=G.includes("lines"),K=q.includes("chars"),Y=q.includes("words"),_=q.includes("lines");if((!z||K)&&(!H||Y)&&(!N||_))return _6($.result,Q);if(N||_)return null;if(Y&&!K&&z){let X=[];for(let U of $.result.words)q$(U,X);$.result.chars=X,$.result.elements=X;let B=D7(q,G);if(J.setAttribute("data-split",B),Z?.mask)W6($.result);return U6(J,$.result),z?X:$.result.words.slice()}if(K&&!Y&&H){let X=Array.from(J.querySelectorAll("[data-split-word-wrap]")),B=[];for(let W=0;W<X.length;W++){let O=X[W];O.removeAttribute("data-split-word-wrap"),O.setAttribute("data-split-word",""),O.setAttribute("data-word-index",String(W)),B.push(O)}$.result.words=B;let U=D7(q,G);return J.setAttribute("data-split",U),z?$.result.chars.slice():B}return null}function _6(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()}function D7(J,$){let Q=new Set([...J,...$]);return["lines","words","chars"].filter((Z)=>Q.has(Z)).join(",")}function q$(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 H of G)if(/\s/.test(H))z.appendChild(document.createTextNode(H));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=H,$.push(N),z.appendChild(N)}q.parentNode?.replaceChild(z,q)}}function W6(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)}}function U6(J,$){let Q=window.getComputedStyle(J);if((Q.getPropertyValue("background-clip")||Q.getPropertyValue("-webkit-background-clip"))!=="text")return;let j=Q.getPropertyValue("background-image"),q=J.querySelectorAll("[data-split-mask], [data-split-word], [data-split-word-wrap], [data-split-char], [data-split-line]");for(let G of q)G.style.backgroundImage=j,G.style.backgroundClip="text",G.style.setProperty("-webkit-background-clip","text"),G.style.setProperty("-webkit-text-fill-color","transparent")}function wJ(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 H of q)if(/^\s+$/.test(H))G.appendChild(document.createTextNode(H.replace(/\n/g," "))),z=!0;else if(H){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=H,$.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;wJ(j,$)}}function O6(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 H=document.createElement("span");H.setAttribute("data-split-word-wrap",""),H.style.display="inline-block",H.style.whiteSpace="nowrap";for(let N of z){let K=document.createElement("span");K.setAttribute("data-split-char",""),K.setAttribute("data-char-index",String($.chars.length)),K.style.display="inline-block",K.textContent=N,$.chars.push(K),H.appendChild(K)}G.appendChild(H)}J.replaceChild(G,Z)}else if(Z.nodeType===1){let j=Z;if(j.tagName==="BR")continue;O6(j,$)}}function I6(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 H=document.createElement("span");H.setAttribute("data-split-word",""),H.setAttribute("data-word-index",String($.words.length)),H.style.display="inline-block",H.style.whiteSpace="nowrap";for(let N of z){let K=document.createElement("span");K.setAttribute("data-split-char",""),K.setAttribute("data-char-index",String($.chars.length)),K.style.display="inline-block",K.textContent=N,$.chars.push(K),H.appendChild(K)}$.words.push(H),G.appendChild(H)}J.replaceChild(G,Z)}else if(Z.nodeType===1){let j=Z;if(j.tagName==="BR")continue;I6(j,$)}}function R7(J,$,Q,Z){let j={chars:[],words:[],lines:[],elements:[]};wJ(J,j);let q=[],G=[],z=-1/0;for(let X of j.words){let B=X.getBoundingClientRect();if(B.top>z+2){if(G.length>0)q.push(G);G=[X],z=B.top}else G.push(X)}if(G.length>0)q.push(G);let H=new Map;for(let X of j.words)H.set(X,G$(X,J));let N="",K=0,Y=0,_=0;for(let X of q){let B="",U=[];for(let W=0;W<X.length;W++){let O=X[W],F=O.textContent||"",A=H.get(O)||[],L=0;while(L<U.length&&L<A.length&&U[L]===A[L])L++;for(let R=U.length-1;R>=L;R--)B+=`</${U[R].tagName.toLowerCase()}>`;if(W>0)B+=" ";for(let R=L;R<A.length;R++)B+=z$(A[R]);if(Q){let R="";for(let h of F)R+=`<span data-split-char data-char-index="${_}" style="display:inline-block">${VJ(h)}</span>`,_++;if($)B+=`<span data-split-word data-word-index="${Y}" style="display:inline-block;white-space:nowrap">${R}</span>`;else B+=R}else if($)B+=`<span data-split-word data-word-index="${Y}" style="display:inline-block">${VJ(F)}</span>`;else B+=VJ(F);Y++,U=A}for(let W=U.length-1;W>=0;W--)B+=`</${U[W].tagName.toLowerCase()}>`;N+=`<span data-split-line data-line-index="${K}" style="display:block">${B}</span>`,K++}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]"))}function G$(J,$){let Q=[],Z=J.parentElement;while(Z&&Z!==$)Q.unshift(Z),Z=Z.parentElement;return Q}function z$(J){let $=J.tagName.toLowerCase(),Q="";for(let Z of Array.from(J.attributes))Q+=` ${Z.name}="${VJ(Z.value)}"`;return`<${$}${Q}>`}function VJ(J){return J.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}class zJ{static split(J,$,Q){if(!(J instanceof HTMLElement))return[];let Z=Q?.consumer,j=S0.get(J);if(j){if(Z&&j.consumers.has(Z)){if((J.getAttribute("data-split")??"")===$)return _6(j.result,$);j.consumers.delete(Z)}if(Z)j.consumers.add(Z);if(j.consumers.size>1){let Y=k7(J,j,$,Q);if(Y!==null)return Y;let _=$.split(",").map((X)=>X.trim());if(_.includes("chars")&&j.result.chars.length>0)return j.result.chars.slice();if(_.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"),S0.delete(J)}let q=J.innerHTML,G={chars:[],words:[],lines:[],elements:[]},z=$.split(",").map((Y)=>Y.trim()),H=z.includes("chars"),N=z.includes("words"),K=z.includes("lines");if(K)R7(J,N,H,G);else if(N&&H)I6(J,G);else if(N)wJ(J,G);else if(H)O6(J,G);if(H)G.elements=G.chars;else if(N)G.elements=G.words;else if(K)G.elements=G.lines;if(Q?.mask&&G.elements.length>0)W6(G);return U6(J,G),S0.set(J,{originalHTML:q,result:G,consumers:new Set(Z?[Z]:[])}),J.setAttribute("data-split",$),G.elements}static revert(J,$){let Q=S0.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"),S0.delete(J),!0}static isSplit(J){return J.hasAttribute("data-split")}static getResult(J){return S0.get(J)?.result}}I.textSplitter={split:(J,$,Q)=>zJ.split(J,$,Q),revert:(J,$)=>zJ.revert(J,$),isSplit:zJ.isSplit};var CJ={alphanumeric:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",alpha:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",numeric:"0123456789",hex:"0123456789ABCDEF",binary:"01",katakana:"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲン",symbols:"!@#$%^&*+-=<>?/|~",blocks:"░▒▓█▄▀■□▪▫"},SJ=80,PJ=400,b7=[2,5],o0=new WeakMap,L0=new WeakMap,l0=new WeakMap;function F6(J){let $=J.parentElement;while($&&typeof $.hasAttribute==="function"&&$.hasAttribute("data-split-word-wrap"))$=$.parentElement;return $}function x7(J){if(!J)return CJ.alphanumeric;return Object.prototype.hasOwnProperty.call(CJ,J)?CJ[J]:J}function s0(J){return J[Math.floor(Math.random()*J.length)]}function A6(J){if(J===void 0){let[Z,j]=b7;return Z+Math.floor(Math.random()*(j-Z+1))}if(typeof J==="number")return Math.max(1,J);let[$,Q]=J;return $+Math.floor(Math.random()*(Q-$+1))}function O0(J){return J===""||J===" "||J===" "||J===`
35
+ `||J==="\t"}function E7(J){let $=J.textContent??"";if(!o0.has(J))o0.set(J,$);return $===" "?" ":$}function H$(J,$){if(!$||$.length===0)return{width:0,char:""};let Q=J.parentElement;if(!Q)return{width:0,char:""};let Z=document.createElement("span"),j=Z.style;j.position="absolute",j.left="-99999px",j.top="0",j.visibility="hidden",j.whiteSpace="pre",j.display="inline-block",j.pointerEvents="none";let q=[],G=new Set;for(let N of $){if(G.has(N))continue;G.add(N);let K=document.createElement("span");K.style.display="inline-block",K.textContent=N,Z.appendChild(K),q.push({el:K,c:N})}Q.appendChild(Z);let z=0,H="";try{for(let{el:N,c:K}of q){let Y=N.getBoundingClientRect().width;if(Y>z)z=Y,H=K}}finally{Q.removeChild(Z)}return{width:z,char:H}}function V7(J,$,Q=PJ,Z=!0,j="none",q=!1,G=""){let z=0,H=0,N="";if(j!=="none"&&$!=="board"){let K=null;for(let Y of J)if(!O0(Y.textContent??""))z=Math.max(z,Y.offsetWidth),K??=Y;if(K&&G){let Y=H$(K,G);if(H=Y.width,N=Y.char,H>z)z=H}z=Math.max(z,8)+4}if(j==="container"&&$!=="board"&&N){let K=new Map;for(let Y of J){let _=F6(Y);if(!_)continue;let X=K.get(_);if(!X)X=[],K.set(_,X);X.push(Y)}for(let[Y,_]of K){if(l0.has(Y))continue;let X=Y.getBoundingClientRect().width,B=0;for(let W of _){if(O0(W.textContent??""))continue;let O=W.getBoundingClientRect().width;if(H>O)B+=H-O}let U=Math.ceil(X+B+2);l0.set(Y,{display:Y.style.display,width:Y.style.width}),Y.style.display="inline-block",Y.style.width=`${U}px`}}if($==="flip"){let K=new Set;for(let Y of J){if(Y.style.display="inline-block",Y.style.backfaceVisibility="hidden",Y.style.verticalAlign="top",j==="cells"&&!O0(Y.textContent??""))Y.style.width=`${z}px`,Y.style.textAlign="center";if(Y.parentElement&&!K.has(Y.parentElement))K.add(Y.parentElement),Y.parentElement.style.height=`${Y.parentElement.offsetHeight}px`}}else if($==="slide")for(let K of J){if(K.style.display="inline-block",K.parentElement)K.parentElement.style.overflow="hidden";if(j==="cells"&&!O0(K.textContent??""))K.style.width=`${z}px`,K.style.textAlign="center"}else if($==="blur"||$==="scale"||$==="fade"||$==="none"){for(let K of J)if(K.style.display="inline-block",j==="cells"&&!O0(K.textContent??""))K.style.width=`${z}px`,K.style.textAlign="center"}else if($==="board"){let K=0;if(Z){for(let Y of J)if(!O0(Y.textContent??""))K=Math.max(K,Y.offsetWidth);K=Math.max(K,8)+4}for(let Y of J){let F=function(Y0){let q0=document.createElement("span"),k=q0.style;return k.display="block",k.position="absolute",k.left="0",k.width="100%",k.height="200%",k.fontSize=U.fontSize,k.fontFamily=U.fontFamily,k.fontWeight=U.fontWeight,k.color=U.color,k.lineHeight=`${O}px`,k.textAlign="center",k.setProperty("-webkit-text-fill-color",U.color),k.top=Y0,q0},A=function(Y0){let q0=document.createElement("div"),k=q0.style;k.position="absolute",k.left="0",k.width="100%",k.height="50%",k.overflow="hidden",k.top=Y0?"50%":"0",k.zIndex="1";let M0=F(Y0?"-100%":"0");return q0.appendChild(M0),[q0,M0]},L=function(Y0="0"){let q0=document.createElement("div"),k=q0.style;k.position="absolute",k.left="0",k.top="0",k.width="100%",k.height="100%",k.overflow="hidden",k.backfaceVisibility="hidden";let M0=F(Y0);return q0.appendChild(M0),[q0,M0]};if(L0.has(Y))continue;let _=Y.textContent??"",X=O0(_);if(X&&!q)continue;let B=X?" ":_,U=window.getComputedStyle(Y),W=Z?K:Y.offsetWidth,O=Y.offsetHeight;Y.textContent="",Y.style.display="inline-block",Y.style.position="relative",Y.style.width=`${W}px`,Y.style.height=`${O}px`,Y.style.perspective=`${Q}px`;let[R,h]=A(!1);h.textContent=B;let[J0,i]=A(!0);i.textContent=B;let n=document.createElement("div"),f=n.style;f.position="absolute",f.left="0",f.top="0",f.width="100%",f.height="50%",f.transformOrigin="center bottom",f.transformStyle="preserve-3d",f.zIndex="2";let[$0,a]=L();a.textContent=B;let[r,w0]=L("-100%");r.style.transform="rotateX(180deg)",w0.textContent=B,n.appendChild($0),n.appendChild(r);let Q0=document.createElement("div"),I0=Q0.style;I0.position="absolute",I0.left="0",I0.width="100%",I0.height="1px",I0.top="calc(50% - 0.5px)",I0.zIndex="3",I0.pointerEvents="none";let r0=document.createElement("div"),j0=r0.style;if(j0.position="absolute",j0.left="0",j0.width="100%",j0.height="50%",j0.top="50%",j0.zIndex="2",j0.pointerEvents="none",j0.opacity="0",j0.background="linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0) 100%)",Y.appendChild(R),Y.appendChild(J0),Y.appendChild(n),Y.appendChild(r0),Y.appendChild(Q0),Q0.style.background=Z?"rgba(0, 0, 0, 0.6)":"rgba(0, 0, 0, 0.15)",Y.style.marginRight=Z?"2px":"1px",Z){R.style.background="linear-gradient(180deg, #2a2a2e 0%, #1e1e22 100%)",R.style.borderRadius="4px 4px 0 0",J0.style.background="linear-gradient(180deg, #1e1e22 0%, #16161a 100%)",J0.style.borderRadius="0 0 4px 4px",$0.style.background="linear-gradient(180deg, #2a2a2e 0%, #1e1e22 100%)",$0.style.borderRadius="4px 4px 0 0",r.style.background="linear-gradient(180deg, #1e1e22 0%, #16161a 100%)",r.style.borderRadius="0 0 4px 4px";for(let M0 of[h,i,a,w0])M0.style.color="#e8e8ec",M0.style.setProperty("-webkit-text-fill-color","#e8e8ec")}L0.set(Y,{staticTop:R,staticBottom:J0,flapWrap:n,flapFront:$0,flapBack:r,splitLine:Q0,shadow:r0,staticTopText:h,staticBottomText:i,flapFrontText:a,flapBackText:w0})}}}function w7(J,$,Q,Z,j,q,G,z){let H=[];for(let K=0;K<Q;K++){let Y=!G&&K===Q-1?$:s0(Z);H.push(Y)}let N=-1;return(K)=>{let Y=Math.min(K,0.9999)*Q,_=Math.floor(Y),X=Y-_,B=X>=0.5,U=_*2+(B?1:0);if(j!=="board"&&U!==N){if(B)J.textContent=G?s0(Z):H[_]??$;else J.textContent=_===0?$:G?s0(Z):H[_-1]??$;N=U}switch(j){case"flip":{let W=X<0.5?-90*(X/0.5):90*(1-(X-0.5)/0.5);x(J,"perspective",q,"px"),x(J,"rotateX",W,"deg"),B0(J);break}case"fade":{let W=X<0.5?1-X/0.5:(X-0.5)/0.5;J.style.opacity=String(W);break}case"slide":{let W=X<0.5?-100*(X/0.5):100*(1-(X-0.5)/0.5),O=X<0.5?1-X/0.5:(X-0.5)/0.5;x(J,"y",W,"%"),B0(J),J.style.opacity=String(O);break}case"blur":{let W=X<0.5?8*(X/0.5):8*(1-(X-0.5)/0.5);J.style.filter=`blur(${W}px)`;break}case"scale":{let W=X<0.5?1-X/0.5:(X-0.5)/0.5;x(J,"scale",W),B0(J);break}case"board":{let W=L0.get(J);if(!W)break;let O=_===0?$:G?s0(Z):H[_-1]??$,F=G?s0(Z):H[_]??$;W.staticTopText.textContent=F,W.flapFrontText.textContent=O,W.flapBackText.textContent=F,W.staticBottomText.textContent=O;let A=-180*X;W.flapWrap.style.transform=`rotateX(${A}deg)`;let L=Math.sin(X*Math.PI);W.shadow.style.opacity=String(L);break}default:break}if(z&&z.length>0){let W=!1;for(let O of z){let F=X<0.5?1-X/0.5:(X-0.5)/0.5,A=O.from+(O.to-O.from)*F;if(O.isTransform)x(J,O.prop,A,O.unit||void 0),W=!0;else J.style[O.prop]=O.unit?`${A}${O.unit}`:String(A)}if(W)B0(J)}}}function C7(J,$,Q,Z){return()=>{if(Q==="board"){let j=L0.get(J);if(j)j.staticTopText.textContent=$,j.staticBottomText.textContent=$,j.flapFrontText.textContent=$,j.flapBackText.textContent=$,j.flapWrap.style.transform="",j.shadow.style.opacity="0";if(Z&&Z.length>0){for(let q of Z)if(!q.isTransform)J.style[q.prop]=q.unit?`${q.to}${q.unit}`:String(q.to)}return}if(J.textContent=$,Q==="flip"||Q==="scale")y(J,!0);else if(Q==="slide")y(J,!0),J.style.opacity="";else if(Q==="fade")J.style.opacity="";else if(Q==="blur")J.style.filter="";if(Z&&Z.length>0){for(let j of Z)if(j.isTransform)x(J,j.prop,j.to,j.unit||void 0);else J.style[j.prop]=j.unit?`${j.to}${j.unit}`:String(j.to);if(Z.some((j)=>j.isTransform))B0(J)}}}class i0{static prepare(J,$,Q=!1,Z){let j=$.type??"flip",q=x7($.charset),G=$.perspective??PJ,z=$.styledBoard??!0,H=$.stableWidth??!1,N=H==="container"?"container":H==="cells"||H===!0?"cells":"none",K=$.preserveWhitespaceCells??!1,Y=[];for(let X of J){let B=E7(X),U=X.textContent??"",W=O0(U),O=W&&K&&j==="board";if(W&&!O)continue;let F=O?" ":B;Y.push({el:X,target:F,isBlankCell:O})}V7(J,j,G,z,N,K,q);let _=[];for(let{el:X,target:B,isBlankCell:U}of Y)if(U)_.push({el:X,render:()=>{},finalize:()=>{}});else{let W=A6($.cycles);_.push({el:X,render:w7(X,B,W,q,j,G,Q,Z),finalize:C7(X,B,j,Z)})}if(_.length===0&&J.length>0){if(J.some((B)=>B.textContent===""))console.warn("[Motion.page SDK] TextFlapper produced zero drivers.","The element likely contains detached char spans from a previous split","(textContent was cleared but spans remain registered).",`Effect type: '${j}'.`,"Fix: call Motion(name).kill() and Motion.reset(element) before re-animating, or mutate innerHTML/textContent on the ORIGINAL container (not the split fragments).",{charElements:J,type:j})}return _}static flap(J,$,Q,Z=!1){let j=i0.prepare(J,$,Z);if(j.length===0)return{kill(){},finished:Promise.resolve(),isComplete:!0};let q=A6($.cycles),G=q*2*SJ+Math.max(0,q-1)*0.5*SJ,z=()=>{},H=new Promise((W)=>{z=W}),N=!1,K=0,Y=0,_=[],X=0;for(let W=0;W<J.length;W++){let O=J[W].textContent??"";if(O0(O))continue;_.push(Q?.[W]??X*SJ*2),X++}let B=performance.now();function U(){if(N)return;let W=performance.now(),O=!0;for(let F=0;F<j.length;F++){let A=j[F],L=W-B-_[F];if(L<0){O=!1;continue}if(Z){let R=L%G/G;A.render(R),O=!1}else{let R=Math.min(L/G,1);if(A.render(R),R>=1)A.finalize();else O=!1}}if(O&&!Z)K=j.length,z();else Y=requestAnimationFrame(U)}if(Y=requestAnimationFrame(U),Z)z();return{kill(){if(N)return;N=!0,cancelAnimationFrame(Y);for(let W of j)W.finalize();z()},get finished(){return H},get isComplete(){return N||K===j.length}}}static revert(J){for(let $ of J){let Q=L0.get($);if(Q)Q.staticTop.remove(),Q.staticBottom.remove(),Q.flapWrap.remove(),Q.splitLine.remove(),Q.shadow.remove(),L0.delete($),$.style.perspective="",$.style.position="",$.style.width="",$.style.height="",$.style.marginRight="";let Z=o0.get($);if(Z!==void 0)$.textContent=Z,o0.delete($);if($.style.display="",$.style.backfaceVisibility="",$.style.overflow="",$.style.transform="",$.style.transition="",$.style.opacity="",$.style.filter="",$.style.width="",$.style.textAlign="",$.style.verticalAlign="",$.parentElement)$.parentElement.style.overflow="",$.parentElement.style.height="";let j=F6($);if(j){let q=l0.get(j);if(q)j.style.display=q.display,j.style.width=q.width,l0.delete(j)}}}}I.textFlapper={prepare:(J,$,Q,Z)=>i0.prepare(J,$,Q,Z),flap:(J,$,Q,Z)=>i0.flap(J,$,Q,Z),revert:(J)=>i0.revert(J)};class S7{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,H)=>{let N=H%Q,K=Math.floor(H/Q);return{originalIndex:H,col:N,row:K}});if(j==="random"){let z=G.map((H)=>({originalIndex:H.originalIndex,order:Math.random()}));return z.sort((H,N)=>H.order-N.order),z.forEach((H,N)=>{H.order=N}),z}return G.map((z)=>{let H;if(typeof j==="number"){let N=j%Q,K=Math.floor(j/Q);H=q==="x"?Math.abs(z.col-N)+Math.abs(z.row-K)*0.5:Math.abs(z.row-K)+Math.abs(z.col-N)*0.5}else if(j==="center"){let N=(Q-1)/2,K=(Z-1)/2;H=Math.abs(z.col-N)+Math.abs(z.row-K)}else if(j==="edges"){let N=Math.min(z.col,Q-1-z.col),K=Math.min(z.row,Z-1-z.row);H=Math.min(N,K)}else if(j==="end")H=q==="x"?(Z-1-z.row)*Q+(Q-1-z.col):(Q-1-z.col)*Z+(Z-1-z.row);else H=q==="x"?z.row*Q+z.col:z.col*Z+z.row;return{originalIndex:z.originalIndex,order:H}})}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}}}I.stagger={resolve:(J,$)=>S7.resolve(J,$)};function N$(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,H=j.left+G/2,N=j.top+z/2,K=q.left+q.width/2,Y=q.top+q.height/2,_=K-H,X=Y-N,B=q.width/G,U=q.height/z;if(!Q)return{dx:_,dy:X,sx:B,sy:U,sourceWidth:j.width,sourceHeight:j.height,targetWidth:q.width,targetHeight:q.height};let W=J.offsetParent??document.documentElement,O=W.getBoundingClientRect(),F=W.scrollLeft??0,A=W.scrollTop??0;return{dx:_,dy:X,sx:B,sy:U,sourceWidth:j.width,sourceHeight:j.height,targetWidth:q.width,targetHeight:q.height,sourceLeft:J.offsetLeft,sourceTop:J.offsetTop,targetLeft:q.left-O.left+F,targetTop:q.top-O.top+A}}function P7(J,$,Q,Z){if(!Z||Z==="px")return Q;if(Z==="%"){let j=J,q=$==="x"?j.offsetWidth:j.offsetHeight;return Q/100*q}if(Z==="vw")return Q/100*window.innerWidth;if(Z==="vh")return Q/100*window.innerHeight;if(Z==="vmin")return Q/100*Math.min(window.innerWidth,window.innerHeight);if(Z==="vmax")return Q/100*Math.max(window.innerWidth,window.innerHeight);if(Z==="em"){let j=parseFloat(window.getComputedStyle(J).fontSize);return Q*j}if(Z==="rem"){let j=parseFloat(window.getComputedStyle(document.documentElement).fontSize);return Q*j}return Q}var s=0.01,n0=0.001;function Y$(J,$,Q,Z){let{absolute:j=!1,scale:q=!0,resize:G=!1}=Q;if($ instanceof HTMLElement)y($,!1);let z=N$($,Q.target,j);if(!z)return;if(!j)if(G){let H=z.dx-(z.targetWidth-z.sourceWidth)/2,N=z.dy-(z.targetHeight-z.sourceHeight)/2;if(Math.abs(H)>s){let K=Z.acquire();K.init($,"x",0,H,"px"),J.addPropTween(K)}if(Math.abs(N)>s){let K=Z.acquire();K.init($,"y",0,N,"px"),J.addPropTween(K)}if(Math.abs(z.targetWidth-z.sourceWidth)>s){let K=Z.acquire();K.init($,"width",z.sourceWidth,z.targetWidth,"px"),J.addPropTween(K)}if(Math.abs(z.targetHeight-z.sourceHeight)>s){let K=Z.acquire();K.init($,"height",z.sourceHeight,z.targetHeight,"px"),J.addPropTween(K)}}else{let H=H0($,"x"),N=H0($,"y"),K=nJ($,"x"),Y=nJ($,"y"),_=P7($,"x",H,K),X=P7($,"y",N,Y),B=_+z.dx,U=X+z.dy;if(Math.abs(B-_)>s||Math.abs(_)>s||Math.abs(B)>s){let W=Z.acquire();W.init($,"x",_,B,"px"),J.addPropTween(W)}if(Math.abs(U-X)>s||Math.abs(X)>s||Math.abs(U)>s){let W=Z.acquire();W.init($,"y",X,U,"px"),J.addPropTween(W)}if(q){let W=H0($,"scaleX"),O=H0($,"scaleY"),F=W*z.sx,A=O*z.sy;if(Math.abs(F-W)>n0||Math.abs(W-1)>n0||Math.abs(F-1)>n0){let L=Z.acquire();L.init($,"scaleX",W,F,""),J.addPropTween(L)}if(Math.abs(A-O)>n0||Math.abs(O-1)>n0||Math.abs(A-1)>n0){let L=Z.acquire();L.init($,"scaleY",O,A,""),J.addPropTween(L)}}}else{let H=$;if(window.getComputedStyle(H).position==="static")H.style.position="absolute";let{sourceLeft:K,sourceTop:Y,targetLeft:_,targetTop:X}=z;if(Math.abs(_-K)>s){let B=Z.acquire();B.init($,"left",K,_,"px"),J.addPropTween(B)}if(Math.abs(X-Y)>s){let B=Z.acquire();B.init($,"top",Y,X,"px"),J.addPropTween(B)}if(q){if(Math.abs(z.targetWidth-z.sourceWidth)>s){let B=Z.acquire();B.init($,"width",z.sourceWidth,z.targetWidth,"px"),J.addPropTween(B)}if(Math.abs(z.targetHeight-z.sourceHeight)>s){let B=Z.acquire();B.init($,"height",z.sourceHeight,z.targetHeight,"px"),J.addPropTween(B)}}}}function K$(J,$,Q,Z){J.setPendingFitSetup((G)=>Y$(J,$,Q,G)),J.setLazyStartCapture(!0);let{absolute:j=!1,resize:q=!1}=Q;J.setFitCleanup(()=>{if($ instanceof HTMLElement){if(y($,!0),q)$.style.width="",$.style.height="";if(j)$.style.width="",$.style.height="",$.style.left="",$.style.top=""}})}I.fit={registerPendingSetup:K$};var yJ=["desktop","laptop","tablet","phone"],y7="[Motion] ResponsiveManager:";function X$(J,$){let{laptops:Q,tablets:Z,phones:j}=$,q="screen";if(J==="desktop")q+=` and (min-width: ${Q+1}px)`;else if(J==="laptop")q+=` and (min-width: ${Z+1}px)`;else if(J==="tablet")q+=` and (min-width: ${j+1}px)`;if(J==="laptop")q+=` and (max-width: ${Q}px)`;else if(J==="tablet")q+=` and (max-width: ${Z}px)`;else if(J==="phone")q+=` and (max-width: ${j}px)`;return q}class v7{variants={};queries=[];activeTier=null;activeTimeline=null;destroyed=!1;register(J,$){this.destroy(),this.destroyed=!1,this.variants=J;let Q=typeof window<"u"?window.matchMedia:void 0;if(typeof Q!=="function"){this.activateTier("desktop");return}for(let Z of yJ){let j=Q.call(window,X$(Z,$)),q=()=>this.handleChange();if(j.addEventListener)j.addEventListener("change",q);else if(j.addListener)j.addListener(q);this.queries.push({tier:Z,mql:j,listener:q})}this.handleChange()}handleChange(){if(this.destroyed)return;let J=this.queries.find((Q)=>Q.mql.matches),$=J?J.tier:"desktop";if($!==this.activeTier)this.activateTier($)}activateTier(J){let $;for(let Z=yJ.indexOf(J);Z>=0;Z--)if(this.variants[yJ[Z]]){$=yJ[Z];break}this.activeTier=J,this.killActive();let Q=$&&this.variants[$];if(!Q)return;try{let Z=Q();this.activeTimeline=Z&&typeof Z.kill==="function"?Z:null}catch(Z){console.error(y7,"error building variant",Z),this.activeTimeline=null}}killActive(){if(this.activeTimeline){try{this.activeTimeline.kill()}catch(J){console.error(y7,"error killing variant",J)}this.activeTimeline=null}}getActiveTier(){return this.activeTier}destroy(){if(this.destroyed)return;this.destroyed=!0;for(let J of this.queries)if(J.mql.removeEventListener)J.mql.removeEventListener("change",J.listener);else if(J.mql.removeListener)J.mql.removeListener(J.listener);this.queries=[],this.killActive(),this.activeTier=null}}I.responsive={create:()=>new v7};var u7=(J)=>J,B$=u7,T={in:(J)=>J*J,out:(J)=>J*(2-J),inOut:(J)=>J<0.5?2*J*J:-1+(4-2*J)*J},E0={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},V0={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},Z0={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 vJ={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},TJ={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}},hJ={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 d7=(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}}},fJ=d7();var c7=(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}}},uJ=c7(),T7=(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},a0={in:(J)=>1-T7(1-J),out:T7,inOut:(J)=>{if(J<0.5)return a0.in(J*2)*0.5;return a0.out(J*2-1)*0.5+0.5}},HJ=(J=0.7,$=0.7,Q=!1)=>{let Z=J!==1?$:0,j=(1-J)/2,q=j+J,G=Q;return(z)=>{let H=z+(0.5-z)*Z;if(z<j){let N=1-z/j;if(G)return 1-N*N;return H-N*N*N*N*H}else if(z>q){let N=(z-q)/j;if(G)return z===1?0:1-N*N;return H+(z-H)*N*N*N*N}return G?1:H}},h7={in:HJ(0.7,0.7,!1),out:HJ(0.7,0.7,!1),inOut:HJ(0.7,0.7,!1)},cJ=(J=1,$=20,Q=!1)=>{let Z=[],j=1/$;for(let q=0;q<$;q++){let G=q*j,H=((q*1327+531)%1000/1000-0.5)*J*0.4,N=G+H;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 H=Z[G],N=Z[z],K=(q-H.x)/(N.x-H.x);return H.y+(N.y-H.y)*K}},_$={in:cJ(1,20,!0),out:cJ(1,20,!0),inOut:cJ(1,20,!0)},mJ=(J)=>{return($)=>{if($>=1)return 1;return Math.floor($*J)/J}},dJ={in:mJ(12),out:mJ(12),inOut:mJ(12)},f7={linear:u7,none:B$,power1:T.out,"power1.in":T.in,"power1.out":T.out,"power1.inout":T.inOut,power2:E0.out,"power2.in":E0.in,"power2.out":E0.out,"power2.inout":E0.inOut,power3:V0.out,"power3.in":V0.in,"power3.out":V0.out,"power3.inout":V0.inOut,power4:Z0.out,"power4.in":Z0.in,"power4.out":Z0.out,"power4.inout":Z0.inOut,quad:T.out,"quad.in":T.in,"quad.out":T.out,"quad.inout":T.inOut,cubic:E0.out,"cubic.in":E0.in,"cubic.out":E0.out,"cubic.inout":E0.inOut,quart:V0.out,"quart.in":V0.in,"quart.out":V0.out,"quart.inout":V0.inOut,quint:Z0.out,"quint.in":Z0.in,"quint.out":Z0.out,"quint.inout":Z0.inOut,strong:Z0.out,"strong.in":Z0.in,"strong.out":Z0.out,"strong.inout":Z0.inOut,sine:vJ.out,"sine.in":vJ.in,"sine.out":vJ.out,"sine.inout":vJ.inOut,expo:TJ.out,"expo.in":TJ.in,"expo.out":TJ.out,"expo.inout":TJ.inOut,circ:hJ.out,"circ.in":hJ.in,"circ.out":hJ.out,"circ.inout":hJ.inOut,back:fJ.out,"back.in":fJ.in,"back.out":fJ.out,"back.inout":fJ.inOut,elastic:uJ.out,"elastic.in":uJ.in,"elastic.out":uJ.out,"elastic.inout":uJ.inOut,bounce:a0.out,"bounce.in":a0.in,"bounce.out":a0.out,"bounce.inout":a0.inOut,slow:h7.inOut,"slow.in":T.out,"slow.out":T.out,"slow.inout":T.out,slowmo:h7.inOut,"slowmo.in":T.out,"slowmo.out":T.out,"slowmo.inout":T.out,rough:_$.inOut,"rough.in":T.out,"rough.out":T.out,"rough.inout":T.out,steps:dJ.inOut,"steps.in":dJ.in,"steps.out":dJ.out,"steps.inout":dJ.inOut},W$={back:(J)=>d7(J),elastic:(J,$)=>c7(J,$),slow:(J,$,Q)=>{let Z=HJ(J,$,Q===1);return{in:Z,out:Z,inOut:Z}},slowmo:(J,$,Q)=>{let Z=HJ(J,$,Q===1);return{in:Z,out:Z,inOut:Z}},rough:(J,$,Q)=>{let Z=cJ(J,$,Q===1);return{in:Z,out:Z,inOut:Z}},steps:(J)=>{let $=mJ(J??12);return{in:$,out:$,inOut:$}}},U$=/^(\w+)(?:\.(\w+))?\(([^)]*)\)$/;function m7(J){let $=J.toLowerCase();if(f7[$])return f7[$];let Q=U$.exec($);if(Q){let[,Z,j,q]=Q,G=W$[Z];if(G){let z=q.split(",").map((H)=>H.trim()).filter((H)=>H.length>0).map(Number);if(z.every((H)=>!isNaN(H))){let H=G(...z),N=j||"out",Y=H[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)`),T.out}class L6{_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;_activationCallback=null;init(J,$,Q,Z,j,q){return this._id=J,this._targets=$,this._duration=Q,this._delay=Z,this._easingFn=m7(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 Q=this.applyEasing(J),Z=this._propTweens;while(Z){if(!$||$(Z))Z.render(Q);Z=Z.next}}renderAtTime(J,$){let Q=Math.max(0,J),Z=this._duration,j=this._delay,q=this._currentRepeat;if(Z===0){let G=Q>=j?1:0;this._time=Q,this._progress=G,this.render(G,$)}else{let G=Math.max(0,Q-j);if(this._repeat===0){let z=Math.min(1,G/Z);this._time=Math.min(Z,G),this._progress=z,this.render(z,$)}else{let z=this._repeatDelay,H=Z+z,N=this._repeat===-1?1/0:Z*(this._repeat+1)+z*this._repeat,K=this._repeat===-1?G:Math.min(G,N),Y=H>0?Math.floor(K/H):0,_=K-Y*H,X=_>Z,B=Z>0?Math.min(1,_/Z):1,U=this._yoyo&&Y%2===1;if(X)B=U?0:1;else if(U)B=1-B;this._currentRepeat=this._repeat===-1?Y:Math.min(Y,this._repeat),this._isReversed=U,this._progress=B,this._time=Z*B,this.render(B,$)}}if(this._isActive){if(!this._startFired){this._startFired=!0;try{this._onStart?.()}catch(G){console.error("[Motion] onStart callback error:",G)}}try{this._onUpdate?.(this._progress)}catch(G){console.error("[Motion] onUpdate callback error:",G)}if(this._currentRepeat>q)try{this._onRepeat?.(this._currentRepeat)}catch(G){console.error("[Motion] onRepeat callback error:",G)}if(!this._completeFired&&this._repeat!==-1){if(Q>=this.totalDuration()){this._completeFired=!0;try{this._onComplete?.()}catch(G){console.error("[Motion] onComplete callback error:",G)}}}}}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._activationCallback?.(),this;if(this._isActive&&!this._isReversed)return this;return this._isActive=!0,this._isReversed=!1,this._activationCallback?.(),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._activationCallback?.(),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._activationCallback?.(),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}setActivationCallback(J){this._activationCallback=J}captureStartValues(){if(!this._needsStartCapture||this._startCaptured)return;if(this._pendingFitSetup){let $=this._propTweens;while($){let Q=$.next;b0.release($),$=Q}this._propTweens=null,this._lastPropTween=null,this._pendingFitSetup(b0),this._pendingFitSetup=null,this._startCaptured=!0;return}let J=this._propTweens;while(J){if(J.target instanceof Element){let{target:$,property:Q}=J;if(J.valueType==="color"&&z0(Q)){let Z=I.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"&&o(Q)){let Z=I.filter?.getCurrentFilter($);if(Z&&J.endFilters){let j=I.filter.mergeFilterArrays(Z,J.endFilters);J.startFilters=j.start,J.endFilters=j.end}}else if(J.valueType==="clipPath"&&f0(Q)){let Z=I.clipPath;if(Z&&J.endClipPath){let j=Z.getCurrentClipPath($);if(j&&Z.canInterpolate(j,J.endClipPath))J.startClipPath=j}}else if(J.valueType==="string");else{let Z=H0($,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}invalidatePathGeometry(){let J=this._propTweens;while(J)J.invalidatePathGeometry(),J=J.next}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,this._activationCallback=null;let J=b0,$=this._propTweens;while($){let Q=$.next;J.release($),$=Q}this._propTweens=null,this._lastPropTween=null}}var NJ=new qJ(()=>new L6,100),p7={acquire:()=>NJ.acquire(),release:(J)=>NJ.release(J),getPoolSize:()=>NJ.getPoolSize(),getTotalCreated:()=>NJ.getTotalCreated(),clear:()=>NJ.clear()};class E{static instance;animations=[];animationIdToIndex=new Map;nextAnimationId=1;totalCreated=0;_animationSnapshot=[];timelines=new Map;_captureTarget=null;ticker;_tickerSubscribed=!1;animationPool;propTweenPool;constructor(){this.ticker=u.getInstance(),this.animationPool=p7,this.propTweenPool=b0}static getInstance(){if(!E.instance)E.instance=new E,P.setEngineRegisterCallback((J,$)=>{let Q=E.instance;if(!Q.hasTimeline(J))Q.registerTimeline(J,$)}),P.setEngineActivationCallback(()=>{E.instance._ensureTickerSubscription()}),c.setCreateAnimationCallback((J,$,Q,Z,j,q,G,z)=>{return E.instance.createAnimation(J,$,Q,Z,j,q,G,z)});return E.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);this._releaseTickerIfIdle()};_ensureTickerSubscription(){if(this._tickerSubscribed)return;this.ticker.add(this.update,0),this._tickerSubscribed=!0}_hasActiveWork(){for(let J=0,$=this.animations.length;J<$;J++){let Q=this.animations[J];if(!Q.isTimelineChild()&&Q.isActive())return!0}for(let J of this.timelines.values())if(J.isActive())return!0;return!1}_releaseTickerIfIdle(){if(!this._tickerSubscribed||this._hasActiveWork())return;this.ticker.remove(this.update),this._tickerSubscribed=!1}createAnimation(J,$,Q,Z,j,q,G,z){let H=z?.stagger;if(H&&J.length>1)return this.createStaggeredAnimations(J,$,Q,Z,j,q,G,H,z);let N=this.animationPool.acquire(),K=this.registerAnimation(N);if(N.init(K,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,H){if(!I.stagger){let Y=this.animationPool.acquire(),_=this.registerAnimation(Y);if(Y.init(_,J,Q,Z,j,H),this.setupPropertyTweens(Y,J,$,q,G),Q===0)Y.render(1);else if(q&&!H?._skipInitialRender)Y.render(0);return[Y]}let N=I.stagger.resolve(J,z),K=[];for(let Y=0;Y<J.length;Y++){let _=J[Y],X=N[Y],B=this.animationPool.acquire(),U=this.registerAnimation(B);if(B.init(U,[_],Q,Z+X,j,H),this.setupPropertyTweens(B,[_],$,q,G),Q===0)B.render(1);else if(q&&!H?._skipInitialRender)B.render(0);K.push(B)}return K}setupPropertyTweens(J,$,Q,Z,j){let q=o7(g7(Q)),G=j?o7(g7(j)):void 0,z=Object.keys(q),H=G?Object.keys(G):[],N=[...new Set([...z,...H])],K="perspective"in q,Y=G&&"perspective"in G,_=K&&Y;for(let X of $){if(!_&&(K||Y)&&X instanceof Element){let B=K?q.perspective:G.perspective,U=typeof B==="number"?B:parseFloat(String(B))||0;if(U>0)x(X,"perspective",U,"px"),X.style.transform=C(X)}for(let B of N){if(B==="perspective"&&!_)continue;let U=q[B],W=JJ(X,B,U,G?G[B]:void 0),O=this.propTweenPool.acquire(),F=Z&&!j;switch(W.type){case"color":{let A=F?W.endColor:W.startColor,L=F?W.startColor:W.endColor;O.initColor(X,B,A,L);break}case"filter":{let A=F?W.endFilters:W.startFilters,L=F?W.startFilters:W.endFilters;O.initFilter(X,B,A,L);break}case"clipPath":{let A=F?W.endClipPath:W.startClipPath,L=F?W.startClipPath:W.endClipPath;O.initClipPath(X,B,A,L);break}case"scalar":{let A=F?W.endValue:W.startValue,L=F?W.startValue:W.endValue,R=F?W.endUnit:W.startUnit,h=F?W.startUnit:W.endUnit;O.init(X,B,A,L,W.unit,R,h);break}case"string":{let A=F?W.endString:W.startString,L=F?W.startString:W.endString;O.initString(X,B,A,L);break}case"drawSVG":{let A=F?W.endDraw:W.startDraw,L=F?W.startDraw:W.endDraw;O.initDrawSVG(X,B,A,L,W.length);break}case"path":{let A=F?W.endProgress:W.startProgress,L=F?W.startProgress:W.endProgress;O.initPath(X,B,W.pathData,W.pathLength,A,L,W.rotate,W.alignOffset,W.pathOffset,W.pathScale,W.alignTarget,W.alignAt,W.pathTarget);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($)),J.setActivationCallback(()=>this._ensureTickerSubscription()),$}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),this._releaseTickerIfIdle()}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(),this._releaseTickerIfIdle()}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){if(this._captureTarget)this._captureTarget.add(J);let $=this.timelines.get(J);if(!$){if($=new P(J),!this.timelines.has(J))this.timelines.set(J,$),$.setUnregisterCallback(()=>this.removeTimeline(J))}return $}startCapture(J){this._captureTarget=J}stopCapture(){this._captureTarget=null}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),this._releaseTickerIfIdle()}killAllTimelines(){for(let J of this.timelines.values())J.kill();this.timelines.clear(),this._releaseTickerIfIdle()}killEverything(){this.killAllTimelines(),this.killAll(),m6()}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 g7(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,H]of Object.entries(J)){if(z==="transform")continue;G[z]=H}return G}function o7(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}class pJ{_fn;_timelineNames=new Set;_reverted=!1;constructor(J){this._fn=J,this._execute()}revert(){if(this._reverted)return;let J=E.getInstance();for(let $ of this._timelineNames)if(J.hasTimeline($))J.getTimeline($).kill();if(typeof document<"u")document.querySelectorAll("[data-scrolltrigger-spacer]").forEach(($)=>$.remove()),document.querySelectorAll("[data-scrolltrigger-markers]").forEach(($)=>$.remove());this._timelineNames.clear(),this._reverted=!0}refresh(){this.revert(),this._reverted=!1,this._execute()}add(J){this._reverted=!1,this._execute(J)}getTimelineNames(){return Array.from(this._timelineNames)}_execute(J){let $=E.getInstance();$.startCapture(this._timelineNames);try{(J||this._fn)()}finally{$.stopCapture()}}}function O$(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 I$(J,$,Q){if(Q===void 0)return(Z)=>Math.min($,Math.max(J,Z));return Math.min($,Math.max(J,Q))}function F$(J,$,Q){let Z=J+Math.random()*($-J);if(Q&&Q>0)return Math.round(Z/Q)*Q;return Z}function A$(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 H=Math.abs(Z-j[z]);if(H<G)G=H,q=j[z]}return q};if($===void 0)return Q;return Q($)}function L$(J,$,Q){return J+($-J)*Q}function M$(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 D$(J,$,Q){let Z=(j)=>(j-J)/($-J);if(Q===void 0)return Z;return Z(Q)}function k$(J,$,Q){let Z=$-J,j=(q)=>{return((q-J)%Z+Z)%Z+J};if(Q===void 0)return j;return j(Q)}var M6={toArray:O$,clamp:I$,random:F$,snap:A$,interpolate:L$,mapRange:M$,normalize:D$,wrap:k$};function e(J,$,Q){let j=E.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}e.reset=function(J){E.getInstance();let $=YJ(J),Q=[];for(let Z of $)if(Z instanceof Element)Q.push(Z);if(Q.length>0)E.getInstance().killAnimationsForTargets(Q);for(let Z of $){if(!(Z instanceof Element))continue;if(I.textSplitter?.isSplit?.(Z))I.textSplitter?.revert?.(Z);y(Z),I.styleReset?.clearAnimationStylesAndUnregister?.(Z),I.styleReset?.clearPinStylesAndUnregister?.(Z)}};e.set=function(J,$){E.getInstance();let Q=new P;Q._addEntry(J,{to:$,duration:0}),Q.kill(!1)};e.get=function(J){let $=E.getInstance();return $.hasTimeline(J)?$.getTimeline(J):void 0};e.has=function(J){return E.getInstance().hasTimeline(J)};e.getNames=function(){return E.getInstance().getTimelineNames()};e.kill=function(J){let $=E.getInstance();if($.hasTimeline(J))$.getTimeline(J).kill()};e.killAll=function(){E.getInstance().killEverything()};e.refreshScrollTriggers=function(){I.triggerManager?.getInstance?.()?.refreshScrollTriggers()};e.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())};e.context=function(J){return new pJ(J)};e.utils=M6;e.responsive=function(J,$,Q){E.getInstance();let Z=I.responsive?.create();if(!Z){let j=$.desktop;if(typeof j==="function")try{j()}catch(q){console.error("[Motion] responsive fallback build failed",q)}return}return Z.register($,Q),Z};var R$=e;var b$={};export{b$ as Types,P as Timeline,M6 as MotionUtils,pJ as MotionContext,R$ as Motion};
34
36
 
35
- //# debugId=4DB380FBE859B18E64756E2164756E21
37
+ //# debugId=09A27F60AF22956164756E2164756E21