@fiddle-digital/string-tune 1.1.27 → 1.1.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +175 -59
- package/dist/index.d.ts +175 -59
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Gt=Object.defineProperty;var pe=Object.getOwnPropertyDescriptor;var de=Object.getOwnPropertyNames;var ue=Object.prototype.hasOwnProperty;var he=(c,t)=>{for(var e in t)Gt(c,e,{get:t[e],enumerable:!0})},me=(c,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of de(t))!ue.call(c,i)&&i!==e&&Gt(c,i,{get:()=>t[i],enumerable:!(r=pe(t,i))||r.enumerable});return c};var ge=c=>me(Gt({},"__esModule",{value:!0}),c);var Ce={};he(Ce,{CursorReactiveModule:()=>zt,StringAnchor:()=>Ct,StringCursor:()=>vt,StringData:()=>N,StringDelayLerpTracker:()=>Dt,StringFPSTracker:()=>Rt,StringForm:()=>Nt,StringGlide:()=>Tt,StringImpulse:()=>qt,StringLazy:()=>St,StringLerp:()=>wt,StringLerpTracker:()=>At,StringLoading:()=>Mt,StringMagnetic:()=>yt,StringModule:()=>f,StringObject:()=>H,StringParallax:()=>Pt,StringPositionTracker:()=>Ht,StringProgress:()=>B,StringProgressPart:()=>Yt,StringResponsive:()=>Et,StringScrollbar:()=>kt,StringScroller:()=>_t,StringSequence:()=>Wt,StringSplit:()=>It,StringTune:()=>te,StringVideoAutoplay:()=>Bt,default:()=>te});module.exports=ge(Ce);var rt=class{constructor(t=.1,e){this.SETTLE_THRESHOLD=.1;this.lastMouseX=0;this.lastMouseY=0;this.lastMouseTime=0;this.smoothingFactor=t,this.context=e,this.onSettingsChange({isDesktop:e.data.viewport.windowWidth>1080,widthChanged:!0,heightChanged:!0,scrollHeightChanged:!0})}onMouseMove(t){this.context.data.cursor.targetX=t.clientX,this.context.data.cursor.targetY=t.clientY;let e=performance.now(),r=e-this.lastMouseTime;r>0&&(this.context.data.cursor.velocityX=(t.clientX-this.lastMouseX)/r,this.context.data.cursor.velocityY=(t.clientY-this.lastMouseY)/r),this.lastMouseX=t.clientX,this.lastMouseY=t.clientY,this.lastMouseTime=e}onFrame(){let{targetX:t,targetY:e,smoothedX:r,smoothedY:i}=this.context.data.cursor,o=this.context.tools.lerp.process({from:r,to:t,progress:this.smoothingFactor}),s=this.context.tools.lerp.process({from:i,to:e,progress:this.smoothingFactor}),n=this.getStepDistance(o,s);this.isSettled(n)?this.snapToTarget():this.applyStep(o,s)}onSettingsChange(t){let e=Number(this.context.settings.lerp);this.setLerpFactor(e)}setLerpFactor(t){this.smoothingFactor=this.context.tools.adaptiveLerp.process({value:t,inMin:.1,inMax:1,outMin:.05,outMax:.65})}getStepDistance(t,e){return Math.hypot(t,e)}isSettled(t){return t<this.SETTLE_THRESHOLD}snapToTarget(){this.context.data.cursor.smoothedX=this.context.data.cursor.targetX,this.context.data.cursor.smoothedY=this.context.data.cursor.targetY,this.context.data.cursor.stepX=0,this.context.data.cursor.stepY=0}applyStep(t,e){this.context.data.cursor.smoothedX+=t,this.context.data.cursor.smoothedY+=e,this.context.data.cursor.stepX=t,this.context.data.cursor.stepY=e}};var A=class{constructor(){this.listeners={};this.stateEvents=new Set;this.lastPayloads={};this.stateEvents.add("screen:mobile"),this.stateEvents.add("screen:tablet"),this.stateEvents.add("screen:laptop"),this.stateEvents.add("screen:desktop"),this.stateEvents.add("start")}on(t,e,r){let i=r?`${t}:${r}`:t;this.listeners[i]||(this.listeners[i]=new Set),this.listeners[i].add(e),this.stateEvents.has(i)&&this.lastPayloads[i]!==void 0&&e(this.lastPayloads[i])}off(t,e,r){let i=r?`${t}:${r}`:t;this.listeners[i]&&this.listeners[i].delete(e)}emit(t,e){this.stateEvents.has(t)&&(this.lastPayloads[t]=e);let r=this.listeners[t];if(r)for(let i of r)i(e)}onProgress(t,e){this.on(`progress:${t}`,e)}emitProgress(t,e){this.emit(`progress:${t}`,e)}onInview(t,e){this.on(`object:inview:${t}`,e)}emitInview(t,e){this.emit(`object:inview:${t}`,e)}onScroll(t){this.on("scroll",t)}emitScroll(t){this.emit("scroll",t)}onUpdate(t){this.on("update",t)}emitUpdate(){this.emit("update")}clear(t){delete this.listeners[t]}clearAll(){this.listeners={}}};var it=class{constructor(t){this.data=t;this.modules=[];this.uiModules=[]}register(t){t.type===1&&this.modules.push(t),t.type===2&&this.uiModules.push(t)}find(t){return this.modules.find(e=>e instanceof t)}onInit(){[...this.modules,...this.uiModules].forEach(t=>t.onInit())}onFrame(){[...this.modules,...this.uiModules].forEach(t=>t.onFrame(this.data))}onScroll(){[...this.modules,...this.uiModules].forEach(t=>t.onScroll(this.data))}onResizeWidth(){[...this.modules,...this.uiModules].forEach(t=>t.onResizeWidth())}onResize(){[...this.modules,...this.uiModules].forEach(t=>t.onResize())}onMouseMove(t){[...this.modules,...this.uiModules].forEach(e=>e.onMouseMove(t))}onWheel(t){[...this.modules,...this.uiModules].forEach(e=>e.onWheel(t))}onDirectionChange(){[...this.modules,...this.uiModules].forEach(t=>t.onDirectionChange())}onScrollStart(){[...this.modules,...this.uiModules].forEach(t=>t.onScrollStart())}onScrollStop(){[...this.modules,...this.uiModules].forEach(t=>t.onScrollStop())}onAxisChange(){[...this.modules,...this.uiModules].forEach(t=>t.onAxisChange())}onDeviceChange(){[...this.modules,...this.uiModules].forEach(t=>t.onDeviceChange())}onScrollConfigChange(){[...this.modules,...this.uiModules].forEach(t=>t.onScrollConfigChange())}onSettingsChange(t){[...this.modules,...this.uiModules].forEach(e=>e.onSettingsChange())}onDOMMutate(t,e){[...this.modules,...this.uiModules].forEach(r=>r.onDOMMutate(t,e))}destroy(){[...this.modules,...this.uiModules].forEach(t=>t.destroy()),this.modules=[],this.uiModules=[]}get all(){return[...this.modules,...this.uiModules]}get core(){return this.modules}get ui(){return this.uiModules}};var H=class{constructor(t,e){this.id="";this.keys=[];this.connects=[];this.properties=new Map;this.modules=[];this.events=new A;this.htmlElement=e,this.id=t}setProperty(t,e){this.properties.set(t,e)}getProperty(t){return this.properties.get(t)??null}enter(){this.events.emit("enter",this),this.setProperty("active",!0),this.modules.forEach(t=>{t.enterObject(this.id,this)})}leave(){this.events.emit("leave",this),this.setProperty("active",!1),this.modules.forEach(t=>{t.exitObject(this.id)})}remove(){this.modules.forEach(t=>{t.removeObject(this.id)})}show(){this.htmlElement.classList.add("-inview")}hide(){this.getProperty("repeat")&&this.htmlElement.classList.remove("-inview")}connect(t){this.modules.includes(t)||this.modules.push(t)}};var ot=class{constructor(t,e,r){this.data=t;this.modules=e;this.events=r;this.objects=new Map;this.connectQueue=[];this.globalId=1}get all(){return this.objects}add(t){let e=`string-${this.globalId++}`,r="string-id";t.getAttribute("string-id")&&(e=t.getAttribute("string-id"),r="string-id"),t.getAttribute("data-string-id")&&(e=t.getAttribute("data-string-id"),r="data-string-id");let i=e&&this.objects.has(e)?this.objects.get(e):new H(e,t);t.setAttribute(r,i.id);let o=t.getAttribute("string")??t.getAttribute("data-string");o&&(i.keys=(o??"").split("|")),t.setAttribute("string-inited",""),this.objects.set(i.id,i);let s=this.getAllAttributes(t);this.modules.core.forEach(a=>{"setupCoreProperties"in a&&typeof a.setupCoreProperties=="function"&&a.setupCoreProperties(i,t,s)}),this.modules.core.forEach(a=>{a.canConnect(i)&&(a.initializeObject(this.globalId,i,t,s),a.calculatePositions(i,this.data.viewport.windowHeight),a.connectObject(i),a.addObject(i.id,i))}),this.connectQueue.filter(a=>a.id===i.id).forEach(a=>i.connects.push(a.element)),this.connectQueue=this.connectQueue.filter(a=>a.id!==i.id),this.initObservers(i,t),this.checkInviewForObject(i)}remove(t){let e=this.objects.get(t);e&&(e.events.clearAll(),e.getProperty("observer-progress")?.disconnect(),e.getProperty("observer-inview")?.disconnect(),e.htmlElement.removeAttribute("string-inited"),e.leave(),e.remove(),this.objects.delete(t))}enqueueConnection(t,e){this.connectQueue.push({id:t,element:e})}getAllAttributes(t){let e={};return Array.from(t.attributes).forEach(r=>{e[r.name]=r.value}),e}initObservers(t,e){let r=t.getProperty("offset-top")??0,i=t.getProperty("offset-bottom")??0;t.getProperty("observer-progress")?.disconnect();let o=n=>{n.forEach(a=>{this.events.emit(`object:activate:${t.id}`,a.isIntersecting),a.isIntersecting?t.enter():t.leave()})},s=new IntersectionObserver(o,{root:null,rootMargin:`${i+this.data.viewport.windowHeight}px 0px ${r+this.data.viewport.windowHeight}px 0px`,threshold:0});s.observe(e),t.setProperty("observer-progress",s)}observeDOM(){new MutationObserver(e=>{e.forEach(r=>{r.type==="childList"&&(r.removedNodes.forEach(i=>{if(i.nodeType!==Node.ELEMENT_NODE)return;let o=i;this.isFixed(o)||(o.hasAttribute("string")&&this.handleRemoved(o),o.querySelectorAll("[string],[data-string]").forEach(s=>{this.isFixed(s)||this.handleRemoved(s)}))}),r.addedNodes.forEach(i=>{if(i.nodeType!==Node.ELEMENT_NODE)return;let o=i;if(this.isFixed(o))return;o.hasAttribute("string")&&!o.hasAttribute("string-inited")&&this.add(o),o.querySelectorAll("[string]:not([string-inited]),[data-string]:not([string-inited])").forEach(n=>this.add(n));let s=o.getAttribute("string-copy-from")??o.getAttribute("data-string-copy-from");s&&(this.objects.has(s)?this.objects.get(s).connects.push(o):this.enqueueConnection(s,o))}),this.modules.all.forEach(i=>i.onDOMRebuild()))})}).observe(document.body,{childList:!0,subtree:!0})}handleRemoved(t){let e=t.getAttribute("string-id")??t.getAttribute("data-string-id");if(!e)return;let r=t.getAttribute("string-copy-from")??t.getAttribute("data-string-copy-from");r&&(this.connectQueue=this.connectQueue.filter(i=>i.id!==r)),this.remove(e)}onSettingsChange(t){this.objects.forEach(e=>{this.modules.core.forEach(r=>{let i=!1;if(t.isDesktop?(r.permissions.desktop.rebuild.scrollHeight&&t.scrollHeightChanged&&(i=!0),r.permissions.desktop.rebuild.width&&t.widthChanged&&(i=!0),r.permissions.desktop.rebuild.height&&t.heightChanged&&(i=!0)):(r.permissions.mobile.rebuild.scrollHeight&&t.scrollHeightChanged&&(i=!0),r.permissions.mobile.rebuild.width&&t.widthChanged&&(i=!0),r.permissions.mobile.rebuild.height&&t.heightChanged&&(i=!0)),i&&r.canConnect(e)){let o=this.getAllAttributes(e.htmlElement);r.initializeObject(this.globalId,e,e.htmlElement,o),r.calculatePositions(e,this.data.viewport.windowHeight),r.connectObject(e)}})})}isFixed(t){return t.hasAttribute("string-fixed")}checkInview(){this.objects.forEach(t=>{this.checkInviewForObject(t)})}checkInviewForObject(t){let e=this.data.scroll.transformedCurrent,r=t.getProperty("inview-start-position"),i=t.getProperty("inview-end-position"),o=t.getProperty("is-inview")??!1,s=e>=r&&e<=i,n=null;!o&&s?n=e<r?"enter-bottom":"enter-top":o&&!s&&(n=e<r?"exit-top":"exit-bottom"),s!==o&&(t.setProperty("is-inview",s),this.events.emit(`object:inview:${t.id}`,{inView:s,direction:n}),s?t.show():t.hide())}};var L=class{constructor(t){this.name="";this.isProg=!1;this.isParallaxEnabled=!1;this._scrollDirection="vertical";this.isBottomScrollDirection=null;this.isLastBottomScrollDirection=!0;this.scrollTriggerRules=[];this.onChangeDirection=()=>{};this.onScrollStart=()=>{};this.onScrollStop=()=>{};this.onCalcUpdate=()=>{this.context.data.scroll.scrollContainer?.scrollTo(0,this.context.data.scroll.current),this.triggerScrollRules()};this.document=document,this.context=t}set scrollDirection(t){this._scrollDirection=t,this._scrollDirection==="vertical"?this.onCalcUpdate=()=>{this.context.data.scroll.scrollContainer?.scrollTo(0,this.context.data.scroll.current),this.triggerScrollRules()}:this._scrollDirection==="horizontal"&&(this.onCalcUpdate=()=>{this.context.data.scroll.scrollContainer?.scrollTo(this.context.data.scroll.current,0)})}onFrame(){}onWheel(t){}onScroll(t){}disableScrollEvents(){}enableScrollEvents(){}triggerScrollRules(){this.scrollTriggerRules.forEach(t=>{(t.direction==="any"||this.isLastBottomScrollDirection&&t.direction==="forward")&&this.context.data.scroll.current>=t.offset?(t.onEnter?.(),t.toggleClass&&t.toggleClass.target.classList.add(t.toggleClass.className)):(t.onLeave?.(),t.toggleClass&&t.toggleClass.target.classList.remove(t.toggleClass.className))})}addScrollMark(t){this.scrollTriggerRules.push(t)}removeScrollMark(t){this.scrollTriggerRules=this.scrollTriggerRules.filter(e=>e.id!==t)}};var st=class extends L{constructor(e){super(e);this.name="default"}onFrame(){if(this.context.data.scroll.delta!==0){let e=this.context.data.scroll.delta*this.context.data.scroll.speedAccelerate;this.context.data.scroll.delta-=e,this.context.data.scroll.lerped=e,Math.abs(this.context.data.scroll.lerped)<.1&&(this.context.data.scroll.delta=0,this.context.data.scroll.lerped=0,this.onScrollStop())}}onScroll(e){let r=this.context.data.scroll.elementContainer.scrollTop;this.context.data.scroll.current=r,this.context.data.scroll.target=r,this.context.data.scroll.transformedCurrent=r}onWheel(e){if(e.deltaY!==0){this.context.data.scroll.delta===0&&this.onScrollStart();let r=e.deltaY;this.context.data.scroll.target===0&&(this.context.data.scroll.delta+=Math.max(0,e.deltaY)),this.context.data.scroll.delta+=r}}};var nt=class extends L{constructor(e){super(e);this.name="disable";this.preventScroll=e=>{e.preventDefault()};this.preventKeyScroll=e=>{["ArrowUp","ArrowDown","PageUp","PageDown"," ","Home","End"].includes(e.key)&&e.preventDefault()};this.onPreventScroll=this.preventScroll.bind(this);this.onPreventKeyScroll=this.preventKeyScroll.bind(this)}disableScrollEvents(){window.addEventListener("touchmove",this.onPreventScroll,{passive:!1}),window.addEventListener("keydown",this.onPreventKeyScroll)}enableScrollEvents(){window.removeEventListener("touchmove",this.onPreventScroll),window.removeEventListener("keydown",this.onPreventKeyScroll)}onFrame(){}onWheel(e){e.preventDefault()}onScroll(e){e.preventDefault()}};var I={SCROLL_FORWARD:"-scroll-forward",SCROLL_BACKWARD:"-scroll-backward",SCROLLING_FORWARD:"-scrolling-forward",SCROLLING_BACKWARD:"-scrolling-backward"};var at=class extends L{constructor(e){super(e);this.name="smooth";this.isScrollbarManipulation=!1;this.scrollForce=0;this.wheelImpulse=0;this.previousCurrent=0;this.velocityThreshold=.1}updateScrollDirection(e){if(this.isLastBottomScrollDirection=e,this.isBottomScrollDirection===null){this.isBottomScrollDirection=e;return}this.context.data.scroll.isScrollingDown=e,this.onChangeDirection(),document.documentElement.classList.toggle(I.SCROLLING_FORWARD,e),document.documentElement.classList.toggle(I.SCROLLING_BACKWARD,!e),document.documentElement.classList.toggle(I.SCROLL_FORWARD,e),document.documentElement.classList.toggle(I.SCROLL_BACKWARD,!e)}stopScroll(){this.context.data.scroll.lerped=0,this.context.data.scroll.delta=0,this.context.data.scroll.target=this.context.data.scroll.current,this.isProg=!1,this.onCalcUpdate(),document.documentElement.classList.remove(I.SCROLLING_BACKWARD,I.SCROLLING_FORWARD),this.isBottomScrollDirection=null}onFrame(){if(this.isScrollbarManipulation){this.isScrollbarManipulation=!1,this.context.data.scroll.current=this.context.data.scroll.elementContainer.scrollTop,this.context.data.scroll.target=this.context.data.scroll.elementContainer.scrollTop,this.context.data.scroll.transformedCurrent=this.context.data.scroll.current*this.context.data.viewport.transformScale;return}if(this.context.data.scroll.delta!==0){this.scrollForce=this.context.data.scroll.delta*this.context.data.scroll.speedAccelerate,this.context.data.scroll.target=Math.min(Math.max(0,this.context.data.scroll.target+this.scrollForce),this.context.data.scroll.bottomPosition),this.context.data.scroll.delta-=this.scrollForce,this.context.data.scroll.lerped=(this.context.data.scroll.target-this.context.data.scroll.current)*this.context.data.scroll.speed;let e=Math.abs(this.context.data.scroll.lerped);this.context.data.scroll.lerped>0?this.context.data.scroll.current=Math.ceil(this.context.data.scroll.current+this.context.data.scroll.lerped):this.context.data.scroll.current=Math.floor(this.context.data.scroll.current+this.context.data.scroll.lerped),this.context.data.scroll.transformedCurrent=this.context.data.scroll.current*this.context.data.viewport.transformScale,this.updateScrollDirection(this.context.data.scroll.lerped>0),e<this.velocityThreshold?(this.stopScroll(),this.onScrollStop()):(this.isProg=!0,this.previousCurrent!==this.context.data.scroll.current&&(this.previousCurrent=this.context.data.scroll.current,this.onCalcUpdate()))}}onWheel(e){if(e.deltaY!==0&&e.preventDefault(),this.wheelImpulse=e.deltaY,this.wheelImpulse===0)return;this.context.data.scroll.delta===0&&this.onScrollStart();let r=Math.sign(this.wheelImpulse),i=this.context.data.scroll.target===0&&r<0,o=this.context.data.scroll.target===this.context.data.scroll.bottomPosition&&r>0;i||o||(this.context.data.scroll.delta+=this.wheelImpulse)}onScroll(e){this.isProg||(this.isScrollbarManipulation=!0)}};var lt=class{constructor(t){this.context=t;this.modes=new Map;this.modes.set("smooth",new at(t)),this.modes.set("default",new st(t)),this.modes.set("disable",new nt(t)),this.updateResponsiveMode()}setMobileMode(t){this.context.data.scroll.modeMobile=t,this.updateResponsiveMode()}setDesktopMode(t){this.context.data.scroll.modeDesktop=t,this.updateResponsiveMode()}updateResponsiveMode(){let e=window.innerWidth<1080?this.context.data.scroll.modeMobile:this.context.data.scroll.modeDesktop;this.setMode(e)}updatePosition(){this.modes.forEach(t=>{t.onCalcUpdate()})}setMode(t){if(!this.modes.has(t)){console.warn(`[ScrollManager] Unknown scroll mode: ${t}`);return}this.get().enableScrollEvents(),this.context.data.scroll.mode=t,this.get().disableScrollEvents()}get(){return this.modes.get(this.context.data.scroll.mode)}getEngines(){return this.modes}onFrame(){this.get().onFrame()}onScroll(t){this.get().onScroll(t)}onWheel(t){this.get().onWheel(t)}bindEvents(t){this.modes.forEach(e=>{e.onScrollStart=t.onScrollStart,e.onScrollStop=t.onScrollStop,e.onChangeDirection=t.onDirectionChange})}addScrollMark(t){this.modes.forEach(e=>{e.addScrollMark(t)})}removeScrollMark(t){this.modes.forEach(e=>{e.removeScrollMark(t)})}};var ct=class{constructor(){this.targetX=0;this.targetY=0;this.smoothedX=0;this.smoothedY=0;this.stepX=0;this.stepY=0;this.velocityX=0;this.velocityY=0}};var pt=class{constructor(){this.threeInstance=null}};var dt=class{constructor(){this.target=0;this.current=0;this.transformedCurrent=0;this.delta=0;this.lerped=0;this.displacement=0;this.isScrollingDown=!1;this.topPosition=0;this.bottomPosition=0;this.direction="vertical";this.elementContainer=document.documentElement;this.scrollContainer=window;this.container=document.body;this.mode="smooth";this.modeMobile="smooth";this.modeDesktop="smooth";this.speed=.1;this.speedAccelerate=.25}};var ut=class{constructor(){this.now=0;this.previous=0;this.delta=0;this.elapsed=0}};var ht=class{constructor(){this.windowWidth=0;this.windowHeight=0;this.contentWidth=0;this.contentHeight=0;this.scaleWidth=1;this.scaleHeight=1;this.transformScale=1;this.baseRem=16}};var N=class{constructor(){this.scroll=new dt;this.viewport=new ht;this.cursor=new ct;this.render=new pt;this.time=new ut}};var mt=class{constructor(){this.desktop={rebuild:{width:!0,height:!0,scrollHeight:!0}};this.mobile={rebuild:{width:!0,height:!0,scrollHeight:!0}}}};var f=class{constructor(t){this.objectMapOnPage=new Map;this.objectsOnPage=[];this.objectMap=new Map;this.objects=[];this.htmlKey="";this._type=1;this.permissions=new mt;this.tools=t.tools,this.data=t.data,this.settings=t.settings,this.events=t.events,this.centers=t.centers,this.hover=t.hover,this.attributesToMap=[{key:"active",type:"boolean",fallback:this.settings.active},{key:"fixed",type:"boolean",fallback:this.settings.fixed},{key:"repeat",type:"boolean",fallback:this.settings.repeat},{key:"self-disable",type:"boolean",fallback:this.settings["self-disable"]},{key:"abs",type:"boolean",fallback:this.settings.abs},{key:"key",type:"string",fallback:this.settings.key},{key:"offset-top",type:"dimension",fallback:this.settings["offset-top"]},{key:"offset-bottom",type:"dimension",fallback:this.settings["offset-bottom"]},{key:"inview-top",type:"dimension",fallback:this.settings["inview-top"]},{key:"inview-bottom",type:"dimension",fallback:this.settings["inview-bottom"]},{key:"start",type:"number",fallback:(e,r,i)=>{let o=i.top;return Math.floor(o)+this.data.scroll.container.scrollTop*this.data.viewport.transformScale}},{key:"end",type:"number",fallback:(e,r,i)=>{let o=i.top,s=i.height;return o+s-this.data.scroll.transformedCurrent}},{key:"size",type:"number",fallback:(e,r,i)=>i.height},{key:"half-width",type:"number",fallback:(e,r,i)=>i.width/2},{key:"half-height",type:"number",fallback:(e,r,i)=>i.height/2},{key:"enter-el",type:"string",fallback:this.settings["enter-el"]},{key:"enter-vp",type:"string",fallback:this.settings["enter-vp"]},{key:"exit-el",type:"string",fallback:this.settings["exit-el"]},{key:"exit-vp",type:"string",fallback:this.settings["exit-vp"]}]}get type(){return this._type}initializeObject(t,e,r,i){let o=this.tools.boundingClientRect.process({element:r});for(let{key:s,type:n,fallback:a,transform:l}of this.attributesToMap){let u=typeof a=="function"?a(r,e,o):a,p=this.tools.domAttribute.process({element:r,key:s,fallback:i[s]??this.settings[s]??u}),d=this.parseAttribute(p,n,{element:r,boundingRect:o,viewportHeight:this.data.viewport.windowHeight,baseRem:this.data.viewport.baseRem});l&&(d=l(d)),e.setProperty(s,d)}}calculatePositions(t,e){let r=t.getProperty("start"),i=t.getProperty("size"),o=t.getProperty("offset-bottom"),s=t.getProperty("offset-top"),n=t.getProperty("enter-el"),a=t.getProperty("enter-vp"),l=t.getProperty("exit-el"),u=t.getProperty("exit-vp"),p=0,d=0,g=0,m=0;n==="top"&&a==="top"||n==="left"&&a==="left"?(g=-e+1,p=r-o):n==="top"&&a==="bottom"||n==="left"&&a==="right"?p=r-e-o:n==="bottom"&&a==="top"||n==="right"&&a==="left"?(g=-e-i+1,p=r+i-o):(n==="bottom"&&a==="bottom"||n==="right"&&a==="right")&&(g=-i+1,p=r-e+i-o),l==="top"&&u==="top"||l==="left"&&u==="left"?(m=-i+1,d=r+s):l==="top"&&u==="bottom"||l==="left"&&u==="right"?(m=-e-i+1,d=r-e+s):l==="bottom"&&u==="top"||l==="right"&&u==="left"?d=r+i+s:(l==="bottom"&&u==="bottom"||l==="right"&&u==="right")&&(m=-e+1,d=r-e+i+s),t.setProperty("start-bias",g),t.setProperty("end-bias",m),t.setProperty("start-position",p-this.data.scroll.topPosition),t.setProperty("end-position",d-this.data.scroll.topPosition),t.setProperty("difference-position",d-p);let h=t.getProperty("inview-top")??0,b=t.getProperty("inview-bottom")??0;t.setProperty("inview-start-position",t.getProperty("start-position")+h),t.setProperty("inview-end-position",t.getProperty("end-position")+b)}parseAttribute(t,e,r={}){if(t==null)return null;if(typeof e=="object"&&e.type==="enum")return e.values.includes(t)?t:e.values[0];switch(e){case"number":return parseFloat(t);case"boolean":return t===""||t==="true";case"json":try{return JSON.parse(t)}catch{return null}case"tuple":return t.trim().split(/\s+/);case"easing":return this.tools.easingFunction.process({easing:t});case"color":return this.tools.colorParser.process({value:t});case"dimension":return t=="0"?0:r.element!=null&&r.viewportHeight!=null&&r.baseRem!=null&&r.boundingRect!=null?this.tools.unitParser.process({value:t,element:r.element,viewportHeight:r.viewportHeight,boundingRect:r.boundingRect,baseRem:r.baseRem}):0;case"breakpoint-dimension":if(r.element!=null&&r.viewportHeight!=null&&r.baseRem!=null&&r.boundingRect!=null){let i=t.trim().split("|"),o=[];for(let s of i)if(s.includes(":")){let[n,a]=s.split(":");o.push({breakpoint:parseInt(n),value:this.tools.unitParser.process({value:`${a}|`,element:r.element,viewportHeight:r.viewportHeight,boundingRect:r.boundingRect,baseRem:r.baseRem})})}else o.push({breakpoint:0,value:this.tools.unitParser.process({value:s,element:r.element,viewportHeight:r.viewportHeight,boundingRect:r.boundingRect,baseRem:r.baseRem})});return o}default:return t}}canConnect(t){return t.keys.includes(this.htmlKey)}connectObject(t){t.connect(this),this.onObjectConnected(t)}enterObject(t,e){this.objectMap.has(t)||(this.objectMap.set(t,e),this.objects.push(e))}exitObject(t){let e=this.objectMap.get(t);if(!e)return;this.objectMap.delete(t);let r=this.objects.indexOf(e);r!==-1&&this.objects.splice(r,1)}addObject(t,e){this.objectMapOnPage.has(t)||(this.objectMapOnPage.set(t,e),this.objectsOnPage.push(e))}removeObject(t){let e=this.objectMapOnPage.get(t);if(!e)return;this.objectMapOnPage.delete(t);let r=this.objectsOnPage.indexOf(e);r!==-1&&this.objectsOnPage.splice(r,1),this.onObjectDisconnected(e)}onObjectConnected(t){}onObjectDisconnected(t){}applyToElementAndConnects(t,e){t.getProperty("self-disable")==!1&&e(t.htmlElement),t.connects.forEach(e)}destroy(){this.objects=[],this.objectMap=new Map}onInit(){}onFrame(t){}onResize(){}onResizeWidth(){}onScroll(t){}onDirectionChange(){}onScrollStart(){}onScrollStop(){}onScrollDirectionChange(){}onAxisChange(){}onDeviceChange(){}onScrollConfigChange(){}onSettingsChange(){}onDOMRebuild(){}onMouseMove(t){}onWheel(t){}onDOMMutate(t,e){}};var V=class{process({element:t}){return t.getBoundingClientRect()}};var $=class{process({element:t,key:e,fallback:r=null}){return t.getAttribute(`string-${e}`)??t.getAttribute(`data-string-${e}`)??r}};var z=class{process({record:t,name:e,fallback:r=null}){return t[e]??t[`data-${e}`]??r}};var D=class{process({element:t}){let e=t.getBoundingClientRect(),i=getComputedStyle(t).transform.match(/-?[\d.]+/g)?.map(parseFloat)??[];if(i.length===6){let[o,s,n,a,l,u]=i,p=o*a-s*n;return{width:e.width/(o||1),height:e.height/(a||1),left:(e.left*a-e.top*n+n*u-l*a)/p,top:(-e.left*s+e.top*o+l*s-o*u)/p}}return e}};var _=class{constructor(t=new D){this.transformTool=t}process({element:t,container:e=document.body}){let r;try{r=e.getBoundingClientRect()}catch{r=document.body.getBoundingClientRect()}let i=this.transformTool.process({element:t});return{top:i.top-r.top,left:i.left-r.left}}};var q=class{process({from:t,to:e,progress:r}){return(e-t)*r}};var Y=class{process({value:t,element:e,viewportHeight:r,baseRem:i,boundingRect:o}){let s=t.split("|").map(a=>a.trim()).filter(Boolean),n=0;for(let a of s){let l=a,u=!1;l.startsWith("-")&&(u=!0,l=l.slice(1));let p=0;l==="selfHeight"?p=e.offsetHeight:l.endsWith("px")?p=parseFloat(l):l.endsWith("%")?p=parseFloat(l)/100*r:l.endsWith("rem")?p=parseFloat(l)*i:l.endsWith("sh")?p=parseFloat(l)*o.height/100:p=parseFloat(l),n+=u?-p:p}return n}};var X=class{process({value:t,inMin:e=.1,inMax:r=1,outMin:i=.05,outMax:o=.65}){if(t<e)return o;if(t>1&&(t=1),t<=r){let s=(t-e)/(r-e);return o-s*(o-i)}return i}};var j=class{process({value:t}){let e=t.trim();if(e.startsWith("random(")&&e.endsWith(")")){let r=e.slice(7,-1).split(",").map(o=>o.trim()).filter(Boolean),i=Math.floor(Math.random()*r.length);return r[i]}return e}};var U=class{process({value:t}){let e=t.trim().toLowerCase();if(e.startsWith("#")){let o=e.slice(1);o.length===3&&(o=o.split("").map(u=>u+u).join(""));let s=parseInt(o.slice(0,2),16),n=parseInt(o.slice(2,4),16),a=parseInt(o.slice(4,6),16),l=o.length===8?parseInt(o.slice(6,8),16)/255:1;return{r:s,g:n,b:a,a:l}}let r=e.match(/rgba?\(([^)]+)\)/);if(r){let[o,s,n,a=1]=r[1].split(",").map(l=>parseFloat(l.trim()));return{r:o,g:s,b:n,a}}let i=e.match(/hsla?\(([^)]+)\)/);if(i){let[o,s,n,a="1"]=i[1].split(",").map(d=>d.trim()),[l,u,p]=this.hslToRgb(parseFloat(o),parseFloat(s),parseFloat(n));return{r:l,g:u,b:p,a:parseFloat(a)}}return{r:0,g:0,b:0,a:0}}hslToRgb(t,e,r){t=t/360,e=parseFloat(e.toString())/100,r=parseFloat(r.toString())/100;let i=(u,p,d)=>(d<0&&(d+=1),d>1&&(d-=1),d<1/6?u+(p-u)*6*d:d<1/2?p:d<2/3?u+(p-u)*(2/3-d)*6:u),o=r<.5?r*(1+e):r+e-r*e,s=2*r-o,n=Math.round(i(s,o,t+1/3)*255),a=Math.round(i(s,o,t)*255),l=Math.round(i(s,o,t-1/3)*255);return[n,a,l]}};var K=class{constructor(){this.namedCurves={linear:[0,0,1,1],ease:[.25,.1,.25,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1]}}process({easing:t}){let e=t.trim();if(this.namedCurves[e])return this.cubicBezier(...this.namedCurves[e]);let r=e.match(/^cubic-bezier\s*\(\s*([-+]?\d*\.?\d+)\s*,\s*([-+]?\d*\.?\d+)\s*,\s*([-+]?\d*\.?\d+)\s*,\s*([-+]?\d*\.?\d+)\s*\)$/);if(r){let[i,o,s,n]=r.slice(1).map(Number);return this.cubicBezier(i,o,s,n)}return i=>i}cubicBezier(t,e,r,i){let o=3*t,s=3*(r-t)-o,n=1-o-s,a=3*e,l=3*(i-e)-a,u=1-a-l;function p(h){return((n*h+s)*h+o)*h}function d(h){return((u*h+l)*h+a)*h}function g(h){return(3*n*h+2*s)*h+o}function m(h,b=1e-5){let M,y,v=h,x,S,E;for(E=0;E<8;E++){if(x=p(v)-h,Math.abs(x)<b)return v;if(S=g(v),Math.abs(S)<1e-6)break;v=v-x/S}for(M=0,y=1,v=h;M<y;){if(x=p(v)-h,Math.abs(x)<b)return v;x>0?y=v:M=v,v=(y+M)/2}return v}return function(h){return d(m(h))}}};var Q=class{process({distance:t,radius:e,strength:r}){if(t>=e)return 0;let i=(e-t)/e;return r*i}};var G=class{process({from:t,to:e,progress:r}){return{r:t.r+(e.r-t.r)*r,g:t.g+(e.g-t.g)*r,b:t.b+(e.b-t.b)*r,a:t.a+(e.a-t.a)*r}}};var Z=class{process({from:t,to:e,progress:r}){return{x:(e.x-t.x)*r,y:(e.y-t.y)*r}}};var J=class{process({value:t}){let r=t?.trim();if(!r||r==="none")return 1;try{if(r.startsWith("matrix(")){let i=r.match(/matrix\(([^)]+)\)/);if(i&&i[1]){let o=i[1].split(",").map(s=>parseFloat(s.trim()));if(o.length>=1&&!isNaN(o[0]))return o[0]}}if(r.startsWith("scale(")){let i=r.match(/scale\(([^)]+)\)/);if(i&&i[1]){let o=i[1].split(",").map(s=>parseFloat(s.trim()));if(o.length>=1&&!isNaN(o[0]))return o[0]}}if(r.startsWith("scaleX(")){let i=r.match(/scaleX\(([^)]+)\)/);if(i&&i[1]){let o=parseFloat(i[1].trim());if(!isNaN(o))return o}}if(r.startsWith("scale3d(")){let i=r.match(/scale3d\(([^)]+)\)/);if(i&&i[1]){let o=i[1].split(",").map(s=>parseFloat(s.trim()));if(o.length>=1&&!isNaN(o[0]))return o[0]}}if(r.startsWith("matrix3d(")){let i=r.match(/matrix3d\(([^)]+)\)/);if(i&&i[1]){let o=i[1].split(",").map(s=>parseFloat(s.trim()));if(o.length>=1&&!isNaN(o[0]))return o[0]}}}catch(i){return console.error(`Error parsing transform string "${r}":`,i),1}return 1}};var gt=class{process({attributeValue:t}){let e={line:[],word:[],char:[],charLine:[],charWord:[],wordLine:[]};return t&&t.split("|").forEach(i=>{let o=i.trim();if(!o)return;let s=o.match(/^(\w+-)?(\w+)(\[(.*?)\])?$/);if(s){let n=s[1]||"",a=s[2],l=n+a,p=(s[4]||"").split(";").map(g=>g.trim()).filter(g=>g.length>0),d=this.parseParamsArray(p);switch(l){case"line":e.line.push(d);break;case"word":e.word.push(d);break;case"char":e.char.push(d);break;case"charLine":e.charLine.push(d);break;case"charWord":e.charWord.push(d);break;case"wordLine":e.wordLine.push(d);break;default:console.warn(`SplitOptionsParserTool: Unrecognized option type "${l}" in part "${o}"`);break}}else console.warn(`SplitOptionsParserTool: Could not parse part format "${o}"`)}),e}parseParamsArray(t){let e={align:"start"};return t.forEach(r=>{if(r==="abs")e.abs=!0;else if(r.startsWith("random")){e.align="random";let i=r.match(/random\(\s*(\d+)\s*,\s*(\d+)\s*\)/);i&&(e.random={min:parseInt(i[1],10),max:parseInt(i[2],10)})}else["start","center","end"].includes(r)&&(e.align=r)}),e}};var tt=class{process({value:t}){let e=[],r="",i=0;for(let o=0;o<t.length;o++){let s=t[o];s==="("&&i++,s===")"&&i--,s==="|"&&i===0?(r.trim()&&e.push(r.trim()),r=""):r+=s}return r.trim()&&e.push(r.trim()),e.map(o=>{let s=o.match(/^(\w+)(?:\((.*)\))?$/);if(!s)return{key:o};let[,n,a]=s;return a?{key:n,params:a.split(",").map(l=>l.trim())}:{key:n}})}};var ft=class{constructor(){this.inputValidators={required:t=>t!=null&&String(t).trim()!=="",min:(t,e)=>typeof t=="string"&&t.length>=Number(e),checked:t=>t===!0||t==="true"||t===1||t==="1",email:t=>typeof t=="string"&&/^[\w-.]+@([\w-]+\.)+[\w-]{2,4}$/.test(t),max:(t,e)=>typeof t=="string"&&t.length<=Number(e),phone:t=>typeof t=="string"&&/^(\+?\d{1,3}[-.\s]?)?(\(?\d{1,4}\)?[-.\s]?)?[\d\-.\s]{5,15}$/.test(t),number:t=>typeof t=="string"&&/^-?\d+(\.\d+)?$/.test(t),url:t=>typeof t=="string"&&/^(https?:\/\/)?([\w\-]+\.)+[\w\-]+(\/[\w\-._~:/?#[\]@!$&'()*+,;=]*)?$/.test(t)};this.beforeInputValidators={number:t=>/^-?\d*\.?\d*$/.test(t),integer:t=>/^-?\d*$/.test(t),email:t=>/^[\w@.\-+]*$/.test(t),phone:t=>/^(\+)?[\d\-() ]*$/.test(t)&&(t.match(/\+/g)?.length??0)<=1&&(!t.includes("+")||t.indexOf("+")===0),letters:t=>/^[a-zA-Z]*$/.test(t),lettersSpaces:t=>/^[a-zA-Z\s]*$/.test(t),lettersNumbers:t=>/^[a-zA-Z0-9]*$/.test(t),url:t=>/^[a-zA-Z0-9\-._~:/?#\[\]@!$&'()*+,;=%]*$/.test(t),pattern:(t,e)=>{try{return new RegExp(e||"").test(t)}catch{return!0}}}}process({rules:t,value:e,type:r="input"}){let i=[];for(let l of t){var o=null,s=null,n=!0,a=!0;r=="input"&&(s=this.inputValidators[l.key],!s)||r=="beforeinput"&&(o=this.beforeInputValidators[l.key],!o)||(s&&(n=s(e,...l.params||[])),o&&(a=o(e,...l.params||[])),a||i.push(this.getErrorMessage(l.key,l.params)),n||i.push(this.getErrorMessage(l.key,l.params)))}return{valid:i.length===0,errors:i}}getErrorMessage(t,e){switch(t){case"required":return"This field is required";case"email":return"Invalid email address";case"min":return`Minimum ${e?.[0]} characters`;case"max":return`Maximum ${e?.[0]} characters`;case"phone":return"Invalid phone number";case"number":return"Only numbers are allowed";case"url":return"Invalid URL address";case"checked":return"You must accept";default:return"Invalid value"}}};var bt=class{constructor(){this.domAttribute=new $;this.recordAttribute=new z;this.transformNullify=new D;this.boundingClientRect=new V;this.relativePosition=new _(this.transformNullify);this.unitParser=new Y;this.lerp=new q;this.adaptiveLerp=new X;this.originParser=new j;this.colorParser=new U;this.validation=new ft;this.easingFunction=new K;this.magneticPull=new Q;this.lerpColor=new G;this.lerpVector=new Z;this.transformScaleParser=new J;this.optionsParser=new gt;this.ruleParser=new tt}};var vt=class extends f{constructor(e){super(e);this.enterObjectsMap=new Map;this.enterObjects=new Array;this.overCount=0;this.htmlKey="cursor",this.permissions.mobile.rebuild.height=!1,this.permissions.mobile.rebuild.width=!1,this.permissions.mobile.rebuild.scrollHeight=!1,this.cursor=document.querySelector("[string-cursor],[data-string-cursor]"),this.cursorContent=document.querySelector("[string-cursor-content],[data-string-cursor-content]"),this.attributesToMap=[...this.attributesToMap,{key:"target-disable",type:"boolean",fallback:this.settings["target-disable"]},{key:"target-style-disable",type:"boolean",fallback:this.settings["target-style-disable"]},{key:"target-class",type:"string",fallback:this.settings["target-class"]},{key:"cursor-class",type:"string",fallback:this.settings["cursor-class"]},{key:"alignment",type:{type:"enum",values:["start","center","end"]},fallback:this.settings.alignment},{key:"lerp",type:"number",fallback:this.settings.lerp,transform:r=>this.tools.adaptiveLerp.process({value:r,inMin:.1,inMax:1,outMin:.05,outMax:.65})}]}initializeObject(e,r,i,o){super.initializeObject(e,r,i,o),r.setProperty("mouse-x",0),r.setProperty("mouse-y",0),r.setProperty("mouse-pixel-x",0),r.setProperty("mouse-pixel-y",0),r.setProperty("is-mouse-over",!1),r.setProperty("is-mouse-move",!1)}onFrame(e){this.objects.forEach(n=>{let a=n.getProperty("is-mouse-over"),l=n.getProperty("cursor-target-disable"),u=n.getProperty("lerp")??.15;if(a&&!l){let p=n.htmlElement.getBoundingClientRect(),d=this.data.cursor.targetX,g=this.data.cursor.targetY,m=d-p.left,h=g-p.top,b=n.getProperty("mouse-pixel-x")??0,M=n.getProperty("mouse-pixel-y")??0,y=b-m,v=M-h;if(y*y+v*v>1e-4){(n.getProperty("is-mouse-move")??!1)||(n.setProperty("is-mouse-move",!0),n.setProperty("mouse-pixel-x",m),n.setProperty("mouse-pixel-y",h),n.setProperty("mouse-x",m),n.setProperty("mouse-y",h),b=m,M=h,this.events.emit(`cursor:start:${n.id}`,null));let E=this.tools.lerp.process({from:b,to:m,progress:u}),C=this.tools.lerp.process({from:M,to:h,progress:u}),T=b+E,w=M+C;n.setProperty("mouse-pixel-x",T),n.setProperty("mouse-pixel-y",w);let O=n.getProperty("alignment")??"center",W=this.calculateOffset(O,T,p.width),k=this.calculateOffset(O,w,p.height);n.setProperty("mouse-x",W),n.setProperty("mouse-y",k),this.setMouseCoordinates(n,W,k),this.events.emit(`cursor:move:${n.id}`,{x:W,y:k}),this.events.emit(`cursor:pixel:${n.id}`,{x:T,y:w})}else n.setProperty("mouse-pixel-x",m),n.setProperty("mouse-pixel-y",h),this.events.emit(`cursor:end:${n.id}`,null)}else{let p=n.getProperty("mouse-x")??0,d=n.getProperty("mouse-y")??0;if(p!==0||d!==0){n.setProperty("is-mouse-move",!1);let g=n.htmlElement.getBoundingClientRect(),m=n.getProperty("half-width")??g.width/2,h=n.getProperty("half-height")??g.height/2,b=this.calculateOffset("center",m,g.width),M=this.calculateOffset("center",h,g.height),y=p+this.tools.lerp.process({from:p,to:b,progress:u}),v=d+this.tools.lerp.process({from:d,to:M,progress:u});n.setProperty("mouse-x",y),n.setProperty("mouse-y",v),Math.abs(y)<.001&&Math.abs(v)<.001&&(n.setProperty("mouse-x",0),n.setProperty("mouse-y",0),n.setProperty("mouse-pixel-x",0),n.setProperty("mouse-pixel-y",0)),this.setMouseCoordinates(n,y,v)}}});let{stepX:r,stepY:i,smoothedX:o,smoothedY:s}=this.data.cursor;(r!==0||i!==0)&&(this.events.emit("cursor",{stepX:r,stepY:i,x:o,y:s}),this.cursor.style.setProperty("--x",o.toString()),this.cursor.style.setProperty("--y",s.toString()),this.cursor.style.setProperty("--x-lerp",r.toString()),this.cursor.style.setProperty("--y-lerp",i.toString()))}onObjectConnected(e){let r=e.htmlElement;e.setProperty("timeoutId",null),e.setProperty("mouseleave",()=>{this.onMouseLeave(e)}),e.setProperty("mouseenter",()=>{this.onMouseEnter(e)}),e.setProperty("onEnterEvent",this.onEnterObject.bind(this)),e.events.on("enter",e.getProperty("onEnterEvent")),e.setProperty("onLeaveEvent",this.onLeaveObject.bind(this)),e.events.on("leave",e.getProperty("onLeaveEvent"))}getCursorClass(e){let r=e.getProperty("cursor-class");return r!=null&&r.length>0?r:null}onMouseEnter(e){this.overCount++,e.setProperty("is-mouse-over",!0);let r=this.getCursorClass(e);this.cursor&&(r&&this.cursor.classList.add(r),this.cursor.classList.add("-showing"),e.setProperty("timeoutId",setTimeout(()=>{this.cursor.classList.remove("-showing"),this.cursor.classList.add("-show")},1200))),e.htmlElement.addEventListener("mouseleave",e.getProperty("mouseleave"))}onMouseLeave(e){this.overCount--,e.setProperty("is-mouse-over",!1),e.getProperty("timeoutId")&&(clearTimeout(e.getProperty("timeoutId")),e.setProperty("timeoutId",null));let r=this.getCursorClass(e);this.cursor&&(r&&this.cursor.classList.remove(r),this.cursor.classList.remove("-showing"),this.cursor.classList.remove("-show")),e.htmlElement.removeEventListener("mouseleave",e.getProperty("mouseleave"))}onEnterObject(e){e.htmlElement.addEventListener("mouseenter",e.getProperty("mouseenter"))}onLeaveObject(e){e.htmlElement.removeEventListener("mouseenter",e.getProperty("mouseenter")),e.htmlElement.removeEventListener("mouseleave",e.getProperty("mouseleave"))}setMouseCoordinates(e,r,i){e.getProperty("cursor-target-style-disable")||this.applyToElementAndConnects(e,o=>{o.style.setProperty("--x",r.toFixed(2)),o.style.setProperty("--y",i.toFixed(2))})}calculateOffset(e,r,i){switch(e){case"start":return r/i;case"end":return(r-i)/i;case"center":default:return(r-i/2)/(i/2)}}};var yt=class extends f{constructor(t){super(t),this.htmlKey="magnetic",this.permissions.mobile.rebuild.height=!1,this.permissions.mobile.rebuild.width=!1,this.permissions.mobile.rebuild.scrollHeight=!1,this.attributesToMap=[...this.attributesToMap,{key:"strength",type:"number",fallback:this.settings.strength},{key:"radius",type:"number",fallback:this.settings.radius}]}initializeObject(t,e,r,i){super.initializeObject(t,e,r,i),e.setProperty("is-magneting",!1),e.setProperty("magnetic-target-x",0),e.setProperty("magnetic-target-y",0),e.setProperty("magnetic-x",0),e.setProperty("magnetic-y",0),e.setProperty("lerp",.1)}onMouseMove(t){this.objects.forEach(e=>{let i=e.htmlElement.getBoundingClientRect(),o=i.left+(e.getProperty("half-width")??0),s=i.top+(e.getProperty("half-height")??0),n=t.clientX-o,a=t.clientY-s,l=Math.sqrt(n**2+a**2),u=e.getProperty("radius")??0,p=e.getProperty("strength")??0,d=this.tools.magneticPull.process({distance:l,radius:u,strength:p});e.setProperty("magnetic-target-x",n*d),e.setProperty("magnetic-target-y",a*d),d>0&&e.setProperty("is-magneting",!0)})}onFrame(t){this.objects.forEach(e=>{if(e.getProperty("is-magneting")){let r=e.getProperty("magnetic-x")??0,i=e.getProperty("magnetic-y")??0,o=e.getProperty("lerp")??0,s=e.getProperty("magnetic-target-x")??0,n=e.getProperty("magnetic-target-y")??0,a=this.tools.lerp.process({from:r,to:s,progress:o}),l=this.tools.lerp.process({from:i,to:n,progress:o});a>-.01&&a<.01&&(a=0,e.setProperty("magnetic-x",e.getProperty("magnetic-target-x"))),l>-.01&&l<.01&&(l=0,e.setProperty("magnetic-y",e.getProperty("magnetic-target-y"))),r+=a,i+=l,e.setProperty("magnetic-x",r),e.setProperty("magnetic-y",i),this.events.emit(`magnetic:move:${e.id}`,{x:r,y:i}),this.applyToElementAndConnects(e,u=>{u.style.setProperty("--magnetic-x",r.toString()),u.style.setProperty("--magnetic-y",i.toString())}),(e.getProperty("magnetic-target-x")==r||e.getProperty("magnetic-target-y")==i)&&e.setProperty("is-magneting",!1)}})}};var St=class extends f{constructor(e){super(e);this.isStartLoaded=!1;this.loadingCount=0;this.htmlKey="lazy"}onInit(){document.querySelectorAll("img[string-lazy], img[data-string-lazy]").forEach(r=>this.loadImage(r)),this.isStartLoaded=!0}onObjectConnected(e){if(this.isStartLoaded){let r=e.htmlElement;this.loadImage(r)}}loadImage(e){if(e.dataset.lazyStatus==="loading"||e.dataset.lazyStatus==="loaded")return;let r=this.tools.domAttribute.process({element:e,key:this.htmlKey,fallback:""});if(!r)return;e.dataset.lazyStatus="loading",e.classList.add("lazyLoad"),this.loadingCount++;let i=new Image;i.onload=()=>{e.style.aspectRatio=`${i.width} / ${i.height}`,e.src=r,e.classList.add("-loaded"),e.dataset.lazyStatus="loaded",this.handleLoadingCompletion()},i.onerror=()=>{console.warn("Failed to load image:",r),e.dataset.lazyStatus="error",this.handleLoadingCompletion()},i.src=r}handleLoadingCompletion(){this.loadingCount--,this.loadingCount<=0&&(this.events.emit("image:load:all",null),this.loadingCount=0)}};var Mt=class extends f{constructor(e){super(e);this.loadingTimeout=0;this._type=2,this.loadingTimeout=this.settings.timeout}onInit(){setTimeout(()=>{document.documentElement.classList.add("-loaded")},this.loadingTimeout)}};var xt=class extends f{constructor(t){super(t),this.htmlKey=""}canConnect(t){return t.keys[0]==null}};var F=class{constructor(t){this.min=void 0;this.max=void 0;this.enable=!0;this.min=t?.min,this.max=t?.max,this.enable=t?.enable??!0}setEnable(t=!0){this.enable=t}setRange(t,e){this.min=t??void 0,this.max=e??void 0}get mediaQuery(){let t="screen";return this.min&&(t+=` and (min-width: ${this.min}px)`),this.max&&(t+=` and (max-width: ${this.max}px)`),t}},Et=class extends f{constructor(e){super(e);this.queries={0:new F({max:359}),1:new F({min:360,max:1079}),2:new F({min:1080,max:1365}),3:new F({min:1366})};this.isMobileMedia=!1;this.isTabletMedia=!1;this.isLaptopMedia=!1;this.isDesktopMedia=!1;this.matchMedias={0:window.matchMedia(this.queries[0].mediaQuery),1:window.matchMedia(this.queries[1].mediaQuery),2:window.matchMedia(this.queries[2].mediaQuery),3:window.matchMedia(this.queries[3].mediaQuery)};this._type=2}onConnect(){}onInit(){if(this.settings!=null&&this.settings.settings!=null){let e=this.settings.settings;e.mobile?(this.queries[0].enable=!0,this.queries[0].setRange(e.mobile.min==null?null:e.mobile.min,e.mobile.max??null),this.matchMedias[0]=window.matchMedia(this.queries[0].mediaQuery)):this.queries[0].enable=!1,e.tablet?(this.queries[1].enable=!0,this.queries[1].setRange(e.tablet.min==null?null:e.tablet.min,e.tablet.max??null),this.matchMedias[1]=window.matchMedia(this.queries[1].mediaQuery)):this.queries[1].enable=!1,e.laptop?(this.queries[2].enable=!0,this.queries[2].setRange(e.laptop.min==null?null:e.laptop.min,e.laptop.max??null),this.matchMedias[2]=window.matchMedia(this.queries[2].mediaQuery)):this.queries[2].enable=!1,e.desktop?(this.queries[3].enable=!0,this.queries[3].setRange(e.desktop.min==null?null:e.desktop.min,e.desktop.max??null),this.matchMedias[3]=window.matchMedia(this.queries[3].mediaQuery)):this.queries[3].enable=!1}this.updateElements()}onResize(){this.updateElements()}updateElements(){let e=this.matchMedias[0].matches&&this.queries[0].enable,r=this.matchMedias[1].matches&&this.queries[1].enable,i=this.matchMedias[2].matches&&this.queries[2].enable,o=this.matchMedias[3].matches&&this.queries[3].enable;this.isMobileMedia!=e&&this.events.emit("screen:mobile",e),this.isTabletMedia!=r&&this.events.emit("screen:tablet",r),this.isLaptopMedia!=i&&this.events.emit("screen:laptop",i),this.isDesktopMedia!=o&&this.events.emit("screen:desktop",o),this.isMobileMedia=e,this.isTabletMedia=r,this.isLaptopMedia=i,this.isDesktopMedia=o,document.querySelectorAll("[string-mobile], [string-tablet], [string-laptop], [string-desktop]").forEach(n=>{let a=!1;n.hasAttribute("string-mobile")&&e&&(a=!0),n.hasAttribute("string-tablet")&&r&&(a=!0),n.hasAttribute("string-laptop")&&i&&(a=!0),n.hasAttribute("string-desktop")&&o&&(a=!0),a?n.style.display=null:n.style.display="none"})}};var Ct=class extends f{constructor(t){super(t),this.htmlKey="anchor",this.attributesToMap=[...this.attributesToMap,{key:"anchor",type:"tuple",fallback:this.settings.anchor,transform:e=>{let[r,i]=e,o=this.tools.originParser.process({value:r}),s=this.tools.originParser.process({value:i});return{x:o,y:s}}}]}onObjectConnected(t){super.onObjectConnected(t);let e=t.getProperty("anchor");e&&this.applyToElementAndConnects(t,r=>{r.style.transformOrigin=`${e.x} ${e.y}`})}};var fe=.05,be=.01,ee=1,ve=-1,ye=1,Tt=class extends f{constructor(e){super(e);this.previousLerp=0;this.displacement=0;this.acceleration=0;this.velocityMultiplier=.00125;this.isInitialScroll=!0;this.baseVelocityMultiplier=.00125;this.reducedVelocityMultiplier=this.baseVelocityMultiplier/20;this.negativeVelocityMultiplier=-1e-4;this.maxDisplacementValue=0;this.setupItem=e=>{let r=e.getProperty("glide")??0,i=-this.data.scroll.displacement*this.maxDisplacementValue*r;this.events.emit(`object:glide:${e.id}`,i);let o=`translate3d(0, ${i}px, 0)`;e.htmlElement.style.transform=o};this.onUpdateDesktopEvent=()=>{for(let e=0;e<this.objects.length;e++){let r=this.objects[e];this.setupItem(r)}};this.onUpdateMobileEvent=()=>{};this.onUpdateEvent=this.onUpdateDesktopEvent;this.htmlKey="glide",this.baseVelocityMultiplier=this.settings["glide-base-velocity"]??this.baseVelocityMultiplier,this.reducedVelocityMultiplier=this.settings["glide-reduce-velocity"]??this.reducedVelocityMultiplier,this.negativeVelocityMultiplier=this.settings["glide-negative-velocity"]??this.negativeVelocityMultiplier,this.attributesToMap=[...this.attributesToMap,{key:"glide",type:"number",fallback:this.settings.glide}]}calcExpanderFactor(e){let r=e?this.data.scroll.lerped<this.previousLerp:this.data.scroll.lerped>this.previousLerp;this.velocityMultiplier=r?this.isInitialScroll?this.baseVelocityMultiplier:this.reducedVelocityMultiplier:this.negativeVelocityMultiplier,r||(this.isInitialScroll=!1)}onStart(){this.maxDisplacementValue=this.data.viewport.windowHeight*.1}onResize(){window.innerWidth>1080?(this.maxDisplacementValue=this.data.viewport.windowHeight*.1,this.onUpdateEvent=this.onUpdateDesktopEvent):(this.onUpdateEvent=this.onUpdateMobileEvent,this.resetState(),this.objects.forEach(e=>{this.setupItem(e)}))}resetState(){this.displacement=0,this.acceleration=0,this.isInitialScroll=!0,this.velocityMultiplier=this.baseVelocityMultiplier}onScrollStart(){this.resetState()}onScrollStop(){this.resetState(),this.previousLerp=0;for(let e=0;e<this.objects.length;e++){let r=this.objects[e],i="translate3d(0, 0px, 0)";r.htmlElement.style.transform=i,r.htmlElement.style.setProperty("--glide",this.data.scroll.displacement.toString())}}onFrame(e){this.calcExpanderFactor(this.data.scroll.isScrollingDown===!1),this.acceleration=Math.min(ee,this.acceleration+fe),this.displacement=Math.max(be,Math.min(ee,this.displacement+this.velocityMultiplier)),this.data.scroll.displacement=Math.min(ye,Math.max(ve,this.data.scroll.lerped*this.displacement*this.acceleration)),this.objects.forEach(r=>{this.applyToElementAndConnects(r,i=>{i.style.setProperty("--glide",this.data.scroll.displacement.toString())})}),this.previousLerp=this.data.scroll.lerped,this.onUpdateEvent()}};var wt=class extends f{constructor(t){super(t),this.htmlKey="lerp"}onScrollStop(){this.objects.forEach(t=>{this.setLerpValue(t,0)})}onFrame(t){let e=t.scroll.lerped;this.objects.forEach(r=>{this.setLerpValue(r,e)})}setLerpValue(t,e){this.events.emit(`object:lerp:${t.id}`,e),t.htmlElement.style.setProperty("--lerp",e.toString())}};var B=class extends f{constructor(t){super(t),this.htmlKey="progress",this.attributesToMap=[...this.attributesToMap,{key:"easing",type:"easing",fallback:this.settings.easing}]}initializeObject(t,e,r,i){super.initializeObject(t,e,r,i)}onScroll(t){super.onScroll(t),this.objects.forEach(e=>{this.setUpObject(e)})}onObjectConnected(t){super.onObjectConnected(t),t.setProperty("setUpObject",this.setUpObject.bind(this)),t.events.on("enter",t.getProperty("setUpObject"))}setUpObject(t){let e=t.getProperty("start-position"),r=t.getProperty("difference-position"),i=t.getProperty("key"),o=t.getProperty("easing")(Math.min(1,Math.max(0,(this.data.scroll.transformedCurrent-e)/r)));if(t.getProperty("progress")!==o){this.events.emit(`object:progress:${t.id}`,o),t.setProperty("progress",o);let s=o.toString();this.applyToElementAndConnects(t,n=>{n.style.setProperty(i,s)})}}};var Pt=class extends B{constructor(e){super(e);this.handleScrollDesktop=()=>{this.objects.forEach(e=>{let r=e.getProperty("progress")??0,i=e.getProperty("parallax")??0,o=e.getProperty("parallax-position-start")??0,s=e.getProperty("parallax-position-end")??1,n=e.getProperty("parallax-sign")??1,a=this.data.viewport.windowHeight,l=n*i*(a*o+r*a*s);this.events.emit(`object:parallax:${e.id}`,l);let u=`translate3d(0, ${l}px, 0)`;this.applyToElementAndConnects(e,p=>{p.style.transform=u})})};this.handleScrollMobile=()=>{};this.scrollHandler=this.handleScrollDesktop;this.htmlKey="parallax",this.attributesToMap=[...this.attributesToMap,{key:"parallax",type:"number",fallback:this.settings.parallax},{key:"parallax-bias",type:"number",fallback:this.settings["parallax-bias"]}]}initializeObject(e,r,i,o){super.initializeObject(e,r,i,o);let s=r.getProperty("parallax-bias")??0,n=Math.abs(r.getProperty("parallax")??.2);r.setProperty("parallax-sign",Math.sign(r.getProperty("parallax"))),r.setProperty("parallax",n),r.setProperty("parallax-position-start",-.5+.5*s),r.setProperty("parallax-position-end",.5+.5*(1-s));let a=this.data.viewport.windowHeight;r.setProperty("offset-top",n*a),r.setProperty("offset-bottom",n*a)}onScroll(e){super.onScroll(e),this.scrollHandler()}onResize(){let e=window.innerWidth>1080;this.scrollHandler=e?this.handleScrollDesktop:this.handleScrollMobile,this.objects.forEach(r=>{let i="translate3d(0, 0px, 0)";this.applyToElementAndConnects(r,o=>{o.style.transform=i})})}};var Lt=class{constructor(t,e,r){this.isDragging=!1;this.startY=0;this.startScrollPosition=0;this.data=t,this.scrollbar=e,this.thumb=r}onResize(){let t=this.data.viewport.contentWidth,e=this.data.viewport.windowWidth,r=e/t*e;this.thumb.style.setProperty("--size",r+"px"),t<=e?this.scrollbar.classList.add("-hide"):this.scrollbar.classList.remove("-hide")}updateThumb(){let t=this.data.viewport.contentWidth,e=this.data.viewport.windowWidth;this.thumb.style.setProperty("--position",`${this.data.scroll.current/t*e+"px"}`)}mouseDownEvent(t){this.startY=t.clientY,this.startScrollPosition=this.data.scroll.current}mouseMoveEvent(t){let e=t.clientY-this.startY,r=this.startScrollPosition+e/this.data.viewport.windowWidth*this.data.viewport.contentWidth;this.data.scroll.current=r,this.data.scroll.target=r,window.scrollTo(0,r),this.updateThumb()}};var Ot=class{constructor(t,e,r){this.isDragging=!1;this.startCoordinate=0;this.startScrollPosition=0;this.data=t,this.scrollbar=e,this.thumb=r}onResize(){let t=this.data.viewport.contentHeight,e=this.data.viewport.windowHeight,r=e/t*e;this.thumb.style.setProperty("--height",r+"px"),t<=e?this.scrollbar.classList.add("-hide"):this.scrollbar.classList.remove("-hide")}updateThumb(){let t=this.data.viewport.contentHeight,e=this.data.viewport.windowHeight;this.thumb.style.setProperty("--position",`${this.data.scroll.current/t*e+"px"}`)}mouseDownEvent(t){this.startCoordinate=t.clientY,this.startScrollPosition=this.data.scroll.current}mouseMoveEvent(t){let e=t.clientY-this.startCoordinate,r=this.startScrollPosition+e/this.data.viewport.windowHeight*this.data.viewport.contentHeight,i=this.data.scroll.bottomPosition,o=Math.max(0,Math.min(r,i));this.data.scroll.current=o,this.data.scroll.target=o,window.scrollTo(0,o),this.updateThumb()}};var kt=class extends f{constructor(e){super(e);this.isDragging=!1;this.scrollMode="smooth";this.mouseUpEventBind=this.mouseUpEvent.bind(this),this.mouseDownEventBind=this.mouseDownEvent.bind(this),this.mouseMoveEventBind=this.mouseMoveEvent.bind(this)}destructor(){document.removeEventListener("mouseup",this.mouseUpEventBind),this.thumb.removeEventListener("mousedown",this.mouseDownEventBind),document.removeEventListener("mousemove",this.mouseMoveEventBind)}onInit(){this.createScrollbar(),this.updateThumb(),this.addCustomStyles(),document.addEventListener("mouseup",this.mouseUpEventBind),this.thumb.addEventListener("mousedown",this.mouseDownEventBind),document.addEventListener("mousemove",this.mouseMoveEventBind),document.documentElement.classList.add("-no-scrollbar")}onScroll(e){this.updateThumb(),this.showScrollbar(),this.hideScrollbar()}onResize(){this.scrollbarState.onResize()}addCustomStyles(){let e=document.createElement("style");e.textContent=`
|
|
1
|
+
"use strict";var ce=Object.defineProperty;var Te=Object.getOwnPropertyDescriptor;var Le=Object.getOwnPropertyNames;var Oe=Object.prototype.hasOwnProperty;var ke=(c,e)=>{for(var t in e)ce(c,t,{get:e[t],enumerable:!0})},Ie=(c,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Le(e))!Oe.call(c,i)&&i!==t&&ce(c,i,{get:()=>e[i],enumerable:!(r=Te(e,i))||r.enumerable});return c};var De=c=>Ie(ce({},"__esModule",{value:!0}),c);var Ke={};ke(Ke,{CursorReactiveModule:()=>z,StringAnchor:()=>Nt,StringCursor:()=>Ot,StringData:()=>X,StringDelayLerpTracker:()=>Ut,StringFPSTracker:()=>Kt,StringForm:()=>ee,StringGlide:()=>Wt,StringImpulse:()=>kt,StringLazy:()=>At,StringLerp:()=>Vt,StringLerpTracker:()=>Qt,StringLoading:()=>Rt,StringMagnetic:()=>It,StringModule:()=>M,StringObject:()=>B,StringParallax:()=>zt,StringPositionTracker:()=>Gt,StringProgress:()=>Y,StringProgressPart:()=>se,StringResponsive:()=>Ft,StringScrollbar:()=>_t,StringScroller:()=>ne,StringSequence:()=>te,StringSplit:()=>jt,StringSpotlight:()=>Dt,StringTune:()=>ge,StringVideoAutoplay:()=>Zt,default:()=>ge,frameDOM:()=>N,styleTxn:()=>L});module.exports=De(Ke);var ut=class{constructor(e=.1,t){this.SETTLE_THRESHOLD=.1;this.lastMouseX=0;this.lastMouseY=0;this.lastMouseTime=0;this.smoothingFactor=e,this.context=t,this.onSettingsChange({isDesktop:t.data.viewport.windowWidth>1080,widthChanged:!0,heightChanged:!0,scrollHeightChanged:!0})}onMouseMove(e){this.context.data.cursor.targetX=e.clientX,this.context.data.cursor.targetY=e.clientY;let t=performance.now(),r=t-this.lastMouseTime;r>0&&(this.context.data.cursor.velocityX=(e.clientX-this.lastMouseX)/r,this.context.data.cursor.velocityY=(e.clientY-this.lastMouseY)/r),this.lastMouseX=e.clientX,this.lastMouseY=e.clientY,this.lastMouseTime=t}onFrame(){let{targetX:e,targetY:t,smoothedX:r,smoothedY:i}=this.context.data.cursor,n=this.context.tools.lerp.process({from:r,to:e,progress:this.smoothingFactor}),o=this.context.tools.lerp.process({from:i,to:t,progress:this.smoothingFactor}),s=this.getStepDistance(n,o);this.isSettled(s)?this.snapToTarget():this.applyStep(n,o)}onSettingsChange(e){let t=Number(this.context.settings["cursor-lerp"]);this.setLerpFactor(t)}setLerpFactor(e){this.smoothingFactor=this.context.tools.adaptiveLerp.process({value:e,inMin:.1,inMax:1,outMin:.05,outMax:.65})}getStepDistance(e,t){return Math.hypot(e,t)}isSettled(e){return e<this.SETTLE_THRESHOLD}snapToTarget(){this.context.data.cursor.smoothedX=this.context.data.cursor.targetX,this.context.data.cursor.smoothedY=this.context.data.cursor.targetY,this.context.data.cursor.stepX=0,this.context.data.cursor.stepY=0}applyStep(e,t){this.context.data.cursor.smoothedX+=e,this.context.data.cursor.smoothedY+=t,this.context.data.cursor.stepX=e,this.context.data.cursor.stepY=t}};var V=class{constructor(){this.listeners={};this.stateEvents=new Set;this.lastPayloads={};this.stateEvents.add("screen:mobile"),this.stateEvents.add("screen:tablet"),this.stateEvents.add("screen:laptop"),this.stateEvents.add("screen:desktop"),this.stateEvents.add("start")}on(e,t,r){let i=r?`${e}:${r}`:e;this.listeners[i]||(this.listeners[i]=new Set),this.listeners[i].add(t),this.stateEvents.has(i)&&this.lastPayloads[i]!==void 0&&t(this.lastPayloads[i])}off(e,t,r){let i=r?`${e}:${r}`:e;this.listeners[i]&&this.listeners[i].delete(t)}emit(e,t){this.stateEvents.has(e)&&(this.lastPayloads[e]=t);let r=this.listeners[e];if(r)for(let i of r)i(t)}onProgress(e,t){this.on(`progress:${e}`,t)}emitProgress(e,t){this.emit(`progress:${e}`,t)}onInview(e,t){this.on(`object:inview:${e}`,t)}emitInview(e,t){this.emit(`object:inview:${e}`,t)}onScroll(e){this.on("scroll",e)}emitScroll(e){this.emit("scroll",e)}onUpdate(e){this.on("update",e)}emitUpdate(){this.emit("update")}clear(e){delete this.listeners[e]}clearAll(){this.listeners={}}};function Ae(c,e,t,r){switch(c){case"onFrame":case"onMutate":case"onScrollMeasure":case"onMouseMoveMeasure":case"onScroll":return[e];case"onMouseMove":case"onWheel":return t?[t]:[];case"onDOMMutate":return t&&r?[t,r]:[];case"onSettingsChange":return[];default:return[]}}var dt=class{constructor(e){this.data=e;this.modules=[];this.uiModules=[];this.allModules=[]}register(e){e.type===1?this.modules.push(e):e.type===2&&this.uiModules.push(e),this.rebuildAllModules()}find(e){return this.modules.find(t=>t instanceof e)}onInit(){this.callAll("onInit")}onFrame(){this.callAll("onFrame")}onMutate(){this.callAll("onMutate")}onScrollMeasure(){this.callAll("onScrollMeasure")}onMouseMoveMeasure(){this.callAll("onMouseMoveMeasure")}onScroll(){this.callAll("onScroll")}onResizeWidth(){this.callAll("onResizeWidth")}onResize(){this.callAll("onResize")}onMouseMove(e){this.callAll("onMouseMove",e)}onWheel(e){this.callAll("onWheel",e)}onDirectionChange(){this.callAll("onDirectionChange")}onScrollStart(){this.callAll("onScrollStart")}onScrollStop(){this.callAll("onScrollStop")}onAxisChange(){this.callAll("onAxisChange")}onDeviceChange(){this.callAll("onDeviceChange")}onScrollConfigChange(){this.callAll("onScrollConfigChange")}onSettingsChange(e){this.callAll("onSettingsChange")}onDOMMutate(e,t){this.callAll("onDOMMutate",e,t)}destroy(){this.callAll("destroy"),this.modules=[],this.uiModules=[],this.allModules=[]}get all(){return this.allModules}get core(){return this.modules}get ui(){return this.uiModules}callAll(e,t,r){this.callLifecycle(this.modules,e,t,r),this.callLifecycle(this.uiModules,e,t,r)}callLifecycle(e,t,r,i){if(e.length===0)return;let n=Ae(t,this.data,r,i);for(let o=0;o<e.length;o++){let s=e[o];s&&s[t](...n)}}rebuildAllModules(){this.allModules=[...this.modules,...this.uiModules]}};var ht=class{constructor(e,t,r){this.parent=r;this.properties=new Map;this.id=e,this.htmlElement=t}get parentObject(){return this.parent}setProperty(e,t){this.properties.set(e,t)}getProperty(e){return this.properties.get(e)??null}setEasing(e){this.easingFn=e??void 0}getEasing(){return this.easingFn}applyProgress(e,t){let r=this.easingFn??t;return r?r(e):e}};var B=class{constructor(e,t){this.id="";this.keys=[];this.mirrors=new Map;this.properties=new Map;this.modules=[];this.events=new V;this.htmlElement=t,this.id=e}setProperty(e,t){this.properties.set(e,t)}getProperty(e){return this.properties.get(e)??null}enter(){this.events.emit("enter",this),this.setProperty("active",!0),this.modules.forEach(e=>{e.enterObject(this.id,this)})}leave(){this.events.emit("leave",this),this.setProperty("active",!1),this.modules.forEach(e=>{e.exitObject(this.id)})}remove(){this.modules.forEach(e=>{e.removeObject(this.id)})}show(){this.htmlElement.classList.add("-inview")}hide(){this.getProperty("repeat")&&this.htmlElement.classList.remove("-inview")}connect(e){this.modules.includes(e)||this.modules.push(e)}addMirror(e){this.mirrors.set(e.id,e)}removeMirror(e){this.mirrors.delete(e)}get mirrorObjects(){return Array.from(this.mirrors.values())}get connects(){return this.mirrorObjects.map(e=>e.htmlElement)}};var mt=class{constructor(e,t,r,i){this.data=e;this.modules=t;this.events=r;this.tools=i;this.objects=new Map;this.connectQueue=[];this.mirrors=new Map;this.mirrorId=1;this.globalId=1}get all(){return this.objects}add(e){let t=`string-${this.globalId++}`,r="string-id";e.getAttribute("string-id")&&(t=e.getAttribute("string-id"),r="string-id"),e.getAttribute("data-string-id")&&(t=e.getAttribute("data-string-id"),r="data-string-id");let i=t&&this.objects.has(t)?this.objects.get(t):new B(t,e);e.setAttribute(r,i.id);let n=e.getAttribute("string")??e.getAttribute("data-string");n&&(i.keys=(n??"").split("|")),e.setAttribute("string-inited",""),this.objects.set(i.id,i);let o=this.getAllAttributes(e);this.modules.core.forEach(a=>{"setupCoreProperties"in a&&typeof a.setupCoreProperties=="function"&&a.setupCoreProperties(i,e,o)}),this.modules.core.forEach(a=>{a.canConnect(i)&&(a.initializeObject(this.globalId,i,e,o),a.calculatePositions(i,this.data.viewport.windowHeight),a.connectObject(i),a.addObject(i.id,i))}),this.connectQueue.filter(a=>a.id===i.id).forEach(a=>this.attachMirrorToObject(i,a.element)),this.connectQueue=this.connectQueue.filter(a=>a.id!==i.id),this.initObservers(i,e),this.checkInviewForObject(i)}remove(e){let t=this.objects.get(e);t&&(t.events.clearAll(),t.getProperty("observer-progress")?.disconnect(),t.getProperty("observer-inview")?.disconnect(),t.htmlElement.removeAttribute("string-inited"),t.leave(),t.remove(),t.mirrorObjects.forEach(r=>{r.htmlElement.removeAttribute("string-mirror-id"),this.mirrors.delete(r.id);let i=r.htmlElement.getAttribute("string-copy-from")??r.htmlElement.getAttribute("data-string-copy-from");i&&this.enqueueConnection(i,r.htmlElement)}),this.objects.delete(e))}enqueueConnection(e,t){this.connectQueue.some(r=>r.id===e&&r.element===t)||this.connectQueue.push({id:e,element:t})}linkMirror(e,t){let r=this.objects.get(e);r?this.attachMirrorToObject(r,t):this.enqueueConnection(e,t)}attachMirrorToObject(e,t){let r=t.getAttribute("string-mirror-id")??t.getAttribute("data-string-mirror-id");if(r){let s=this.mirrors.get(r);if(s){if(s.parentObject===e)return s;s.parentObject.removeMirror(r),this.mirrors.delete(r)}}let i=r??`string-mirror-${this.mirrorId++}`,n=new ht(i,t,e);t.setAttribute("string-mirror-id",i),e.addMirror(n),this.mirrors.set(i,n);let o=t.getAttribute("string-easing")??t.getAttribute("data-string-easing");return o&&o.trim().length>0&&(n.setEasing(this.tools.easingFunction.process({easing:o})),n.setProperty("easing",o)),n}detachMirrorByElement(e){let t=e.getAttribute("string-mirror-id")??e.getAttribute("data-string-mirror-id");t&&(this.detachMirrorById(t),e.removeAttribute("string-mirror-id"))}detachMirrorById(e){let t=this.mirrors.get(e);t&&(t.parentObject.removeMirror(e),this.mirrors.delete(e))}getAllAttributes(e){let t={};return Array.from(e.attributes).forEach(r=>{t[r.name]=r.value}),t}initObservers(e,t){let r=e.getProperty("offset-top")??0,i=e.getProperty("offset-bottom")??0;e.getProperty("observer-progress")?.disconnect();let n=b=>{b.forEach(m=>{this.events.emit(`object:activate:${e.id}`,m.isIntersecting),m.isIntersecting?e.enter():e.leave()})},o=e.getProperty("outside-container"),s=t.getAttribute("string-outside-container")??t.getAttribute("data-string-outside-container"),a=s!=null?s.trim().toLowerCase():null,l=a===""||a==="true"||a==="1",d=o!=null?o===!0:l,p=this.data.scroll.container===document.body||d?null:this.data.scroll.container,u=new IntersectionObserver(n,{root:p,rootMargin:`${i+this.data.viewport.windowHeight}px 0px ${r+this.data.viewport.windowHeight}px 0px`,threshold:0});u.observe(t),e.setProperty("observer-progress",u)}observeDOM(){new MutationObserver(t=>{t.forEach(r=>{r.type==="childList"&&(r.removedNodes.forEach(i=>{if(i.nodeType!==Node.ELEMENT_NODE)return;let n=i;this.detachMirrorByElement(n),!this.isFixed(n)&&(n.hasAttribute("string")&&this.handleRemoved(n),n.querySelectorAll("[string],[data-string]").forEach(o=>{this.isFixed(o)||this.handleRemoved(o)}),n.querySelectorAll("[string-copy-from],[data-string-copy-from]").forEach(o=>this.detachMirrorByElement(o)))}),r.addedNodes.forEach(i=>{if(i.nodeType!==Node.ELEMENT_NODE)return;let n=i;if(this.isFixed(n))return;n.hasAttribute("string")&&!n.hasAttribute("string-inited")&&this.add(n),n.querySelectorAll("[string]:not([string-inited]),[data-string]:not([string-inited])").forEach(s=>this.add(s));let o=n.getAttribute("string-copy-from")??n.getAttribute("data-string-copy-from");o&&this.linkMirror(o,n),n.querySelectorAll("[string-copy-from],[data-string-copy-from]").forEach(s=>{let a=s.getAttribute("string-copy-from")??s.getAttribute("data-string-copy-from");a&&this.linkMirror(a,s)})}),this.modules.all.forEach(i=>i.onDOMRebuild()))})}).observe(document.body,{childList:!0,subtree:!0})}handleRemoved(e){let t=e.getAttribute("string-id")??e.getAttribute("data-string-id");if(!t)return;let r=e.getAttribute("string-copy-from")??e.getAttribute("data-string-copy-from");r&&(this.connectQueue=this.connectQueue.filter(i=>i.id!==r)),this.remove(t)}onSettingsChange(e){this.objects.forEach(t=>{this.modules.core.forEach(r=>{let i=!1;if(e.isDesktop?(r.permissions.desktop.rebuild.scrollHeight&&e.scrollHeightChanged&&(i=!0),r.permissions.desktop.rebuild.width&&e.widthChanged&&(i=!0),r.permissions.desktop.rebuild.height&&e.heightChanged&&(i=!0)):(r.permissions.mobile.rebuild.scrollHeight&&e.scrollHeightChanged&&(i=!0),r.permissions.mobile.rebuild.width&&e.widthChanged&&(i=!0),r.permissions.mobile.rebuild.height&&e.heightChanged&&(i=!0)),i&&r.canConnect(t)){let n=this.getAllAttributes(t.htmlElement);r.initializeObject(this.globalId,t,t.htmlElement,n),r.calculatePositions(t,this.data.viewport.windowHeight),r.connectObject(t)}})})}isFixed(e){return e.hasAttribute("string-fixed")}checkInview(){this.objects.forEach(e=>{this.checkInviewForObject(e)})}checkInviewForObject(e){let t=this.data.scroll.transformedCurrent,r=e.getProperty("inview-start-position"),i=e.getProperty("inview-end-position"),n=e.getProperty("is-inview")??!1,o=Math.min(r,i),s=Math.max(r,i),a=t>=o&&t<=s,l=null;if(!n&&a){let d=Math.abs(t-o),p=Math.abs(s-t);l=d<=p?"enter-top":"enter-bottom"}else n&&!a&&(l=t<o?"exit-top":"exit-bottom");a!==n&&(e.setProperty("is-inview",a),this.events.emit(`object:inview:${e.id}`,{inView:a,direction:l}),a?e.show():e.hide())}};var R=class{constructor(e){this.name="";this.isProg=!1;this.isParallaxEnabled=!1;this._scrollDirection="vertical";this.isBottomScrollDirection=null;this.isLastBottomScrollDirection=!0;this.scrollTriggerRules=[];this.onChangeDirection=()=>{};this.onScrollStart=()=>{};this.onScrollStop=()=>{};this.onCalcUpdate=()=>{this.context.data.scroll.scrollContainer?.scrollTo(0,this.context.data.scroll.current),this.triggerScrollRules()};this.document=document,this.context=e}set scrollDirection(e){this._scrollDirection=e,this._scrollDirection==="vertical"?this.onCalcUpdate=()=>{this.context.data.scroll.scrollContainer?.scrollTo(0,this.context.data.scroll.current),this.triggerScrollRules()}:this._scrollDirection==="horizontal"&&(this.onCalcUpdate=()=>{this.context.data.scroll.scrollContainer?.scrollTo(this.context.data.scroll.current,0)})}onFrame(){}onWheel(e){}onScroll(e){}disableScrollEvents(){}enableScrollEvents(){}triggerScrollRules(){this.scrollTriggerRules.forEach(e=>{(e.direction==="any"||this.isLastBottomScrollDirection&&e.direction==="forward")&&this.context.data.scroll.current>=e.offset?(e.onEnter?.(),e.toggleClass&&e.toggleClass.target.classList.add(e.toggleClass.className)):(e.onLeave?.(),e.toggleClass&&e.toggleClass.target.classList.remove(e.toggleClass.className))})}addScrollMark(e){this.scrollTriggerRules.push(e)}removeScrollMark(e){this.scrollTriggerRules=this.scrollTriggerRules.filter(t=>t.id!==e)}scrollTo(e){}};var gt=class extends R{constructor(t){super(t);this.name="default"}onFrame(){if(this.context.data.scroll.delta!==0){let t=this.context.data.scroll.delta*this.context.data.scroll.speedAccelerate;this.context.data.scroll.delta-=t,this.context.data.scroll.lerped=t,Math.abs(this.context.data.scroll.lerped)<.1&&(this.context.data.scroll.delta=0,this.context.data.scroll.lerped=0,this.onScrollStop())}}onScroll(t){let r=this.context.data.scroll.elementContainer.scrollTop;this.context.data.scroll.current=r,this.context.data.scroll.target=r,this.context.data.scroll.transformedCurrent=r}onWheel(t){if(t.deltaY!==0){this.context.data.scroll.delta===0&&this.onScrollStart();let r=t.deltaY;this.context.data.scroll.target===0&&(this.context.data.scroll.delta+=Math.max(0,t.deltaY)),this.context.data.scroll.delta+=r}}scrollTo(t){this.context.data.scroll.target=t,this.context.data.scroll.delta=1}};var ft=class extends R{constructor(t){super(t);this.name="disable";this.preventScroll=t=>{t.preventDefault()};this.preventKeyScroll=t=>{["ArrowUp","ArrowDown","PageUp","PageDown"," ","Home","End"].includes(t.key)&&t.preventDefault()};this.onPreventScroll=this.preventScroll.bind(this);this.onPreventKeyScroll=this.preventKeyScroll.bind(this)}disableScrollEvents(){window.addEventListener("touchmove",this.onPreventScroll,{passive:!1}),window.addEventListener("keydown",this.onPreventKeyScroll)}enableScrollEvents(){window.removeEventListener("touchmove",this.onPreventScroll),window.removeEventListener("keydown",this.onPreventKeyScroll)}onFrame(){}onWheel(t){t.preventDefault()}onScroll(t){t.preventDefault()}};var H={SCROLL_FORWARD:"-scroll-forward",SCROLL_BACKWARD:"-scroll-backward",SCROLLING_FORWARD:"-scrolling-forward",SCROLLING_BACKWARD:"-scrolling-backward"};var bt=class extends R{constructor(t){super(t);this.name="smooth";this.isScrollbarManipulation=!1;this.scrollForce=0;this.wheelImpulse=0;this.previousCurrent=0;this.velocityThreshold=.1}updateScrollDirection(t){if(this.isLastBottomScrollDirection=t,this.isBottomScrollDirection===null){this.isBottomScrollDirection=t;return}this.context.data.scroll.isScrollingDown=t,this.onChangeDirection(),this.context.events.emit("scroll:direction:change",this.context.data.scroll.isScrollingDown),this.context.settings["global-class"]&&(document.documentElement.classList.toggle(H.SCROLLING_FORWARD,t),document.documentElement.classList.toggle(H.SCROLLING_BACKWARD,!t),document.documentElement.classList.toggle(H.SCROLL_FORWARD,t),document.documentElement.classList.toggle(H.SCROLL_BACKWARD,!t))}stopScroll(){this.context.data.scroll.lerped=0,this.context.data.scroll.delta=0,this.context.data.scroll.target=this.context.data.scroll.current,this.isProg=!1,this.onCalcUpdate(),document.documentElement.classList.remove(H.SCROLLING_BACKWARD,H.SCROLLING_FORWARD),this.isBottomScrollDirection=null}onFrame(){if(this.isScrollbarManipulation){this.isScrollbarManipulation=!1,this.context.data.scroll.current=this.context.data.scroll.elementContainer.scrollTop,this.context.data.scroll.target=this.context.data.scroll.elementContainer.scrollTop,this.context.data.scroll.transformedCurrent=this.context.data.scroll.current*this.context.data.viewport.transformScale;return}if(this.context.data.scroll.delta!==0){this.scrollForce=this.context.data.scroll.delta*this.context.data.scroll.speedAccelerate,this.context.data.scroll.target=Math.min(Math.max(0,this.context.data.scroll.target+this.scrollForce),this.context.data.scroll.bottomPosition),this.context.data.scroll.delta-=this.scrollForce,this.context.data.scroll.lerped=(this.context.data.scroll.target-this.context.data.scroll.current)*this.context.data.scroll.speed;let t=Math.abs(this.context.data.scroll.lerped);this.context.data.scroll.lerped>0?this.context.data.scroll.current=Math.ceil(this.context.data.scroll.current+this.context.data.scroll.lerped):this.context.data.scroll.current=Math.floor(this.context.data.scroll.current+this.context.data.scroll.lerped),this.context.data.scroll.transformedCurrent=this.context.data.scroll.current*this.context.data.viewport.transformScale,this.updateScrollDirection(this.context.data.scroll.lerped>0),t<this.velocityThreshold?(this.stopScroll(),this.onScrollStop()):(this.isProg=!0,this.previousCurrent!==this.context.data.scroll.current&&(this.previousCurrent=this.context.data.scroll.current,this.onCalcUpdate()))}}onWheel(t){if(t.deltaY!==0&&t.preventDefault(),this.wheelImpulse=t.deltaY,this.wheelImpulse===0)return;this.context.data.scroll.delta===0&&this.onScrollStart();let r=Math.sign(this.wheelImpulse),i=this.context.data.scroll.target===0&&r<0,n=this.context.data.scroll.target===this.context.data.scroll.bottomPosition&&r>0;i||n||(this.context.data.scroll.delta+=this.wheelImpulse)}onScroll(t){this.isProg||(this.isScrollbarManipulation=!0)}scrollTo(t){this.context.data.scroll.target=t,this.context.data.scroll.delta=1}};var vt=class{constructor(e){this.context=e;this.modes=new Map;this.modes.set("smooth",new bt(e)),this.modes.set("default",new gt(e)),this.modes.set("disable",new ft(e)),this.updateResponsiveMode()}setMobileMode(e){this.context.data.scroll.modeMobile=e,this.updateResponsiveMode()}setDesktopMode(e){this.context.data.scroll.modeDesktop=e,this.updateResponsiveMode()}updateResponsiveMode(){let t=window.innerWidth<1080?this.context.data.scroll.modeMobile:this.context.data.scroll.modeDesktop;this.setMode(t)}updatePosition(){this.modes.forEach(e=>{e.onCalcUpdate()})}setMode(e){if(!this.modes.has(e)){console.warn(`[ScrollManager] Unknown scroll mode: ${e}`);return}this.get().enableScrollEvents(),this.context.data.scroll.mode=e,this.get().disableScrollEvents()}get(){return this.modes.get(this.context.data.scroll.mode)}getEngines(){return this.modes}onFrame(){this.get().onFrame()}onScroll(e){this.get().onScroll(e)}onWheel(e){this.get().onWheel(e)}bindEvents(e){this.modes.forEach(t=>{t.onScrollStart=e.onScrollStart,t.onScrollStop=e.onScrollStop,t.onChangeDirection=e.onDirectionChange})}addScrollMark(e){this.modes.forEach(t=>{t.addScrollMark(e)})}removeScrollMark(e){this.modes.forEach(t=>{t.removeScrollMark(e)})}};var yt=class{constructor(){this.targetX=0;this.targetY=0;this.smoothedX=0;this.smoothedY=0;this.stepX=0;this.stepY=0;this.velocityX=0;this.velocityY=0}};var St=class{constructor(){this.threeInstance=null}};var Mt=class{constructor(){this.target=0;this.current=0;this.transformedCurrent=0;this.delta=0;this.lerped=0;this.displacement=0;this.isScrollingDown=!1;this.topPosition=0;this.bottomPosition=0;this.direction="vertical";this.elementContainer=document.documentElement;this.scrollContainer=window;this.container=document.body;this.mode="smooth";this.modeMobile="smooth";this.modeDesktop="smooth";this.speed=.1;this.speedAccelerate=.25}};var xt=class{constructor(){this.fpsTracker=!1;this.positionTracker=!1}};var Et=class{constructor(){this.now=0;this.previous=0;this.delta=0;this.elapsed=0}};var Ct=class{constructor(){this.windowWidth=0;this.windowHeight=0;this.contentWidth=0;this.contentHeight=0;this.scaleWidth=1;this.scaleHeight=1;this.transformScale=1;this.baseRem=16}};var X=class{constructor(){this.scroll=new Mt;this.viewport=new Ct;this.cursor=new yt;this.render=new St;this.time=new Et;this.system=new xt}};var Pt=class{constructor(){this.desktop={rebuild:{width:!0,height:!0,scrollHeight:!0}};this.mobile={rebuild:{width:!0,height:!0,scrollHeight:!0}}}};var M=class{constructor(e){this.objectMapOnPage=new Map;this.objectsOnPage=[];this.objectMap=new Map;this.objects=[];this.htmlKey="";this._type=1;this.permissions=new Pt;this.tools=e.tools,this.data=e.data,this.settings=e.settings,this.events=e.events,this.centers=e.centers,this.hover=e.hover,this.attributesToMap=[{key:"active",type:"boolean",fallback:this.settings.active},{key:"fixed",type:"boolean",fallback:this.settings.fixed},{key:"outside-container",type:"boolean",fallback:this.settings["outside-container"]},{key:"repeat",type:"boolean",fallback:this.settings.repeat},{key:"self-disable",type:"boolean",fallback:this.settings["self-disable"]},{key:"abs",type:"boolean",fallback:this.settings.abs},{key:"key",type:"string",fallback:this.settings.key},{key:"offset-top",type:"dimension",fallback:this.settings["offset-top"]},{key:"offset-bottom",type:"dimension",fallback:this.settings["offset-bottom"]},{key:"inview-top",type:"dimension",fallback:this.settings["inview-top"]},{key:"inview-bottom",type:"dimension",fallback:this.settings["inview-bottom"]},{key:"start",type:"number",fallback:(t,r,i)=>{let n=i.top;return Math.floor(n)+this.data.scroll.container.scrollTop*this.data.viewport.transformScale}},{key:"end",type:"number",fallback:(t,r,i)=>{let n=i.top,o=i.height;return n+o-this.data.scroll.transformedCurrent}},{key:"size",type:"number",fallback:(t,r,i)=>i.height},{key:"half-width",type:"number",fallback:(t,r,i)=>i.width/2},{key:"half-height",type:"number",fallback:(t,r,i)=>i.height/2},{key:"enter-el",type:"string",fallback:this.settings["enter-el"]},{key:"enter-vp",type:"string",fallback:this.settings["enter-vp"]},{key:"exit-el",type:"string",fallback:this.settings["exit-el"]},{key:"exit-vp",type:"string",fallback:this.settings["exit-vp"]}]}get type(){return this._type}initializeObject(e,t,r,i){let n=this.tools.boundingClientRect.process({element:r});for(let{key:o,type:s,fallback:a,transform:l}of this.attributesToMap){let d=typeof a=="function"?a(r,t,n):a,p=this.tools.domAttribute.process({element:r,key:o,fallback:i[o]??this.settings[o]??d}),u=this.parseAttribute(p,s,{element:r,boundingRect:n,viewportHeight:this.data.viewport.windowHeight,baseRem:this.data.viewport.baseRem});l&&(u=l(u)),t.setProperty(o,u)}}calculatePositions(e,t){let r=e.getProperty("start"),i=e.getProperty("size"),n=e.getProperty("offset-bottom"),o=e.getProperty("offset-top"),s=e.getProperty("enter-el"),a=e.getProperty("enter-vp"),l=e.getProperty("exit-el"),d=e.getProperty("exit-vp"),p=0,u=0,b=0,m=0;s==="top"&&a==="top"||s==="left"&&a==="left"?(b=-t+1,p=r-n):s==="top"&&a==="bottom"||s==="left"&&a==="right"?p=r-t-n:s==="bottom"&&a==="top"||s==="right"&&a==="left"?(b=-t-i+1,p=r+i-n):(s==="bottom"&&a==="bottom"||s==="right"&&a==="right")&&(b=-i+1,p=r-t+i-n),l==="top"&&d==="top"||l==="left"&&d==="left"?(m=-i+1,u=r+o):l==="top"&&d==="bottom"||l==="left"&&d==="right"?(m=-t-i+1,u=r-t+o):l==="bottom"&&d==="top"||l==="right"&&d==="left"?u=r+i+o:(l==="bottom"&&d==="bottom"||l==="right"&&d==="right")&&(m=-t+1,u=r-t+i+o),e.setProperty("start-bias",b),e.setProperty("end-bias",m),e.setProperty("start-position",p-this.data.scroll.topPosition),e.setProperty("end-position",u-this.data.scroll.topPosition),e.setProperty("difference-position",u-p);let h=e.getProperty("inview-top")??0,v=e.getProperty("inview-bottom")??0;e.setProperty("inview-start-position",e.getProperty("start-position")+h),e.setProperty("inview-end-position",e.getProperty("end-position")+v)}parseAttribute(e,t,r={}){if(e==null)return null;if(typeof t=="object"&&t.type==="enum")return t.values.includes(e)?e:t.values[0];switch(t){case"number":return parseFloat(e);case"boolean":return e===""||e==="true";case"json":try{return JSON.parse(e)}catch{return null}case"tuple":return e.trim().split(/\s+/);case"easing":return this.tools.easingFunction.process({easing:e});case"color":return this.tools.colorParser.process({value:e});case"dimension":return e=="0"?0:r.element!=null&&r.viewportHeight!=null&&r.baseRem!=null&&r.boundingRect!=null?this.tools.unitParser.process({value:e,element:r.element,viewportHeight:r.viewportHeight,boundingRect:r.boundingRect,baseRem:r.baseRem}):0;case"breakpoint-dimension":if(r.element!=null&&r.viewportHeight!=null&&r.baseRem!=null&&r.boundingRect!=null){let i=e.trim().split("|"),n=[];for(let o of i)if(o.includes(":")){let[s,a]=o.split(":");n.push({breakpoint:parseInt(s),value:this.tools.unitParser.process({value:`${a}|`,element:r.element,viewportHeight:r.viewportHeight,boundingRect:r.boundingRect,baseRem:r.baseRem})})}else n.push({breakpoint:0,value:this.tools.unitParser.process({value:o,element:r.element,viewportHeight:r.viewportHeight,boundingRect:r.boundingRect,baseRem:r.baseRem})});return n}default:return e}}canConnect(e){return e.keys.includes(this.htmlKey)}connectObject(e){e.connect(this),this.onObjectConnected(e)}enterObject(e,t){this.objectMap.has(e)||(this.objectMap.set(e,t),this.objects.push(t))}exitObject(e){let t=this.objectMap.get(e);if(!t)return;this.objectMap.delete(e);let r=this.objects.indexOf(t);r!==-1&&this.objects.splice(r,1)}addObject(e,t){this.objectMapOnPage.has(e)||(this.objectMapOnPage.set(e,t),this.objectsOnPage.push(t))}removeObject(e){let t=this.objectMapOnPage.get(e);if(!t)return;this.objectMapOnPage.delete(e);let r=this.objectsOnPage.indexOf(t);r!==-1&&this.objectsOnPage.splice(r,1),this.onObjectDisconnected(t)}onObjectConnected(e){}onObjectDisconnected(e){}applyToElementAndConnects(e,t,r=t){e.getProperty("self-disable")==!1&&t(e.htmlElement),e.mirrorObjects.forEach(i=>r(i.htmlElement,i))}destroy(){this.objects=[],this.objectMap=new Map}onInit(){}onFrame(e){}onMutate(e){}onScrollMeasure(e){}onMouseMoveMeasure(e){}onResize(){}onResizeWidth(){}onScroll(e){}onDirectionChange(){}onScrollStart(){}onScrollStop(){}onScrollDirectionChange(){}onAxisChange(){}onDeviceChange(){}onScrollConfigChange(){}onSettingsChange(){}onDOMRebuild(){}onMouseMove(e){}onWheel(e){}onDOMMutate(e,t){}};var j=class{process({element:e}){return e.getBoundingClientRect()}};var U=class{process({element:e,key:t,fallback:r=null}){return e.getAttribute(`string-${t}`)??e.getAttribute(`data-string-${t}`)??r}};var K=class{process({record:e,name:t,fallback:r=null}){return e[t]??e[`data-${t}`]??r}};var F=class{process({element:e}){let t=e.getBoundingClientRect(),i=getComputedStyle(e).transform.match(/-?[\d.]+/g)?.map(parseFloat)??[];if(i.length===6){let[n,o,s,a,l,d]=i,p=n*a-o*s;return{width:t.width/(n||1),height:t.height/(a||1),left:(t.left*a-t.top*s+s*d-l*a)/p,top:(-t.left*o+t.top*n+l*o-n*d)/p}}return t}};var Q=class{constructor(e=new F){this.transformTool=e}process({element:e,container:t=document.body}){let r;try{r=t.getBoundingClientRect()}catch{r=document.body.getBoundingClientRect()}let i=this.transformTool.process({element:e});return{top:i.top-r.top,left:i.left-r.left}}};var G=class{process({from:e,to:t,progress:r}){return(t-e)*r}};var J=class{process({value:e,element:t,viewportHeight:r,baseRem:i,boundingRect:n}){let o=e.split("|").map(a=>a.trim()).filter(Boolean),s=0;for(let a of o){let l=a,d=!1;l.startsWith("-")&&(d=!0,l=l.slice(1));let p=0;l==="selfHeight"?p=t.offsetHeight:l.endsWith("px")?p=parseFloat(l):l.endsWith("%")?p=parseFloat(l)/100*r:l.endsWith("rem")?p=parseFloat(l)*i:l.endsWith("sh")?p=parseFloat(l)*n.height/100:p=parseFloat(l),s+=d?-p:p}return s}};var Z=class{process({value:e,inMin:t=.1,inMax:r=1,outMin:i=.05,outMax:n=.65}){if(e<t)return n;if(e>1&&(e=1),e<=r){let o=(e-t)/(r-t);return n-o*(n-i)}return i}};var tt=class{process({value:e}){let t=e.trim();if(t.startsWith("random(")&&t.endsWith(")")){let r=t.slice(7,-1).split(",").map(n=>n.trim()).filter(Boolean),i=Math.floor(Math.random()*r.length);return r[i]}return t}};var et=class{process({value:e}){let t=e.trim().toLowerCase();if(t.startsWith("#")){let n=t.slice(1);n.length===3&&(n=n.split("").map(d=>d+d).join(""));let o=parseInt(n.slice(0,2),16),s=parseInt(n.slice(2,4),16),a=parseInt(n.slice(4,6),16),l=n.length===8?parseInt(n.slice(6,8),16)/255:1;return{r:o,g:s,b:a,a:l}}let r=t.match(/rgba?\(([^)]+)\)/);if(r){let[n,o,s,a=1]=r[1].split(",").map(l=>parseFloat(l.trim()));return{r:n,g:o,b:s,a}}let i=t.match(/hsla?\(([^)]+)\)/);if(i){let[n,o,s,a="1"]=i[1].split(",").map(u=>u.trim()),[l,d,p]=this.hslToRgb(parseFloat(n),parseFloat(o),parseFloat(s));return{r:l,g:d,b:p,a:parseFloat(a)}}return{r:0,g:0,b:0,a:0}}hslToRgb(e,t,r){e=e/360,t=parseFloat(t.toString())/100,r=parseFloat(r.toString())/100;let i=(d,p,u)=>(u<0&&(u+=1),u>1&&(u-=1),u<1/6?d+(p-d)*6*u:u<1/2?p:u<2/3?d+(p-d)*(2/3-u)*6:d),n=r<.5?r*(1+t):r+t-r*t,o=2*r-n,s=Math.round(i(o,n,e+1/3)*255),a=Math.round(i(o,n,e)*255),l=Math.round(i(o,n,e-1/3)*255);return[s,a,l]}};var rt=class{constructor(){this.namedCurves={linear:[0,0,1,1],ease:[.25,.1,.25,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1]}}process({easing:e}){let t=e.trim();if(this.namedCurves[t])return this.cubicBezier(...this.namedCurves[t]);let r=t.match(/^cubic-bezier\s*\(\s*([-+]?\d*\.?\d+)\s*,\s*([-+]?\d*\.?\d+)\s*,\s*([-+]?\d*\.?\d+)\s*,\s*([-+]?\d*\.?\d+)\s*\)$/);if(r){let[i,n,o,s]=r.slice(1).map(Number);return this.cubicBezier(i,n,o,s)}return i=>i}cubicBezier(e,t,r,i){let n=3*e,o=3*(r-e)-n,s=1-n-o,a=3*t,l=3*(i-t)-a,d=1-a-l;function p(h){return((s*h+o)*h+n)*h}function u(h){return((d*h+l)*h+a)*h}function b(h){return(3*s*h+2*o)*h+n}function m(h,v=1e-5){let y,g,E=h,x,S,C;for(C=0;C<8;C++){if(x=p(E)-h,Math.abs(x)<v)return E;if(S=b(E),Math.abs(S)<1e-6)break;E=E-x/S}for(y=0,g=1,E=h;y<g;){if(x=p(E)-h,Math.abs(x)<v)return E;x>0?g=E:y=E,E=(g+y)/2}return E}return function(h){return u(m(h))}}};var it=class{process({distance:e,radius:t,strength:r}){if(e>=t)return 0;let i=(t-e)/t;return r*i}};var nt=class{process({from:e,to:t,progress:r}){return{r:e.r+(t.r-e.r)*r,g:e.g+(t.g-e.g)*r,b:e.b+(t.b-e.b)*r,a:e.a+(t.a-e.a)*r}}};var st=class{process({from:e,to:t,progress:r}){return{x:(t.x-e.x)*r,y:(t.y-e.y)*r}}};var ot=class{process({value:e}){let r=e?.trim();if(!r||r==="none")return 1;try{if(r.startsWith("matrix(")){let i=r.match(/matrix\(([^)]+)\)/);if(i&&i[1]){let n=i[1].split(",").map(o=>parseFloat(o.trim()));if(n.length>=1&&!isNaN(n[0]))return n[0]}}if(r.startsWith("scale(")){let i=r.match(/scale\(([^)]+)\)/);if(i&&i[1]){let n=i[1].split(",").map(o=>parseFloat(o.trim()));if(n.length>=1&&!isNaN(n[0]))return n[0]}}if(r.startsWith("scaleX(")){let i=r.match(/scaleX\(([^)]+)\)/);if(i&&i[1]){let n=parseFloat(i[1].trim());if(!isNaN(n))return n}}if(r.startsWith("scale3d(")){let i=r.match(/scale3d\(([^)]+)\)/);if(i&&i[1]){let n=i[1].split(",").map(o=>parseFloat(o.trim()));if(n.length>=1&&!isNaN(n[0]))return n[0]}}if(r.startsWith("matrix3d(")){let i=r.match(/matrix3d\(([^)]+)\)/);if(i&&i[1]){let n=i[1].split(",").map(o=>parseFloat(o.trim()));if(n.length>=1&&!isNaN(n[0]))return n[0]}}}catch(i){return console.error(`Error parsing transform string "${r}":`,i),1}return 1}};var wt=class{process({attributeValue:e}){let t={line:[],word:[],char:[],charLine:[],charWord:[],wordLine:[]};return e&&e.split("|").forEach(i=>{let n=i.trim();if(!n)return;let o=n.match(/^(\w+-)?(\w+)(\[(.*?)\])?$/);if(o){let s=o[1]||"",a=o[2],l=s+a,p=(o[4]||"").split(";").map(b=>b.trim()).filter(b=>b.length>0),u=this.parseParamsArray(p);switch(l){case"line":t.line.push(u);break;case"word":t.word.push(u);break;case"char":t.char.push(u);break;case"charLine":t.charLine.push(u);break;case"charWord":t.charWord.push(u);break;case"wordLine":t.wordLine.push(u);break;default:console.warn(`SplitOptionsParserTool: Unrecognized option type "${l}" in part "${n}"`);break}}else console.warn(`SplitOptionsParserTool: Could not parse part format "${n}"`)}),t}parseParamsArray(e){let t={align:"start"};return e.forEach(r=>{if(r==="abs")t.abs=!0;else if(r.startsWith("random")){t.align="random";let i=r.match(/random\(\s*(\d+)\s*,\s*(\d+)\s*\)/);i&&(t.random={min:parseInt(i[1],10),max:parseInt(i[2],10)})}else["start","center","end"].includes(r)&&(t.align=r)}),t}};var at=class{process({value:e}){let t=[],r="",i=0;for(let n=0;n<e.length;n++){let o=e[n];o==="("&&i++,o===")"&&i--,o==="|"&&i===0?(r.trim()&&t.push(r.trim()),r=""):r+=o}return r.trim()&&t.push(r.trim()),t.map(n=>{let o=n.match(/^(\w+)(?:\((.*)\))?$/);if(!o)return{key:n};let[,s,a]=o;return a?{key:s,params:a.split(",").map(l=>l.trim())}:{key:s}})}};var Tt=class{constructor(){this.inputValidators={required:e=>e!=null&&String(e).trim()!=="",min:(e,t)=>typeof e=="string"&&e.length>=Number(t),checked:e=>e===!0||e==="true"||e===1||e==="1",email:e=>typeof e=="string"&&/^[\w-.]+@([\w-]+\.)+[\w-]{2,4}$/.test(e),max:(e,t)=>typeof e=="string"&&e.length<=Number(t),phone:e=>typeof e=="string"&&/^(\+?\d{1,3}[-.\s]?)?(\(?\d{1,4}\)?[-.\s]?)?[\d\-.\s]{5,15}$/.test(e),number:e=>typeof e=="string"&&/^-?\d+(\.\d+)?$/.test(e),url:e=>typeof e=="string"&&/^(https?:\/\/)?([\w\-]+\.)+[\w\-]+(\/[\w\-._~:/?#[\]@!$&'()*+,;=]*)?$/.test(e)};this.beforeInputValidators={number:e=>/^-?\d*\.?\d*$/.test(e),integer:e=>/^-?\d*$/.test(e),email:e=>/^[\w@.\-+]*$/.test(e),phone:e=>/^(\+)?[\d\-() ]*$/.test(e)&&(e.match(/\+/g)?.length??0)<=1&&(!e.includes("+")||e.indexOf("+")===0),letters:e=>/^[a-zA-Z]*$/.test(e),lettersSpaces:e=>/^[a-zA-Z\s]*$/.test(e),lettersNumbers:e=>/^[a-zA-Z0-9]*$/.test(e),url:e=>/^[a-zA-Z0-9\-._~:/?#\[\]@!$&'()*+,;=%]*$/.test(e),pattern:(e,t)=>{try{return new RegExp(t||"").test(e)}catch{return!0}}}}process({rules:e,value:t,type:r="input"}){let i=[];for(let l of e){var n=null,o=null,s=!0,a=!0;r=="input"&&(o=this.inputValidators[l.key],!o)||r=="beforeinput"&&(n=this.beforeInputValidators[l.key],!n)||(o&&(s=o(t,...l.params||[])),n&&(a=n(t,...l.params||[])),a||i.push(this.getErrorMessage(l.key,l.params)),s||i.push(this.getErrorMessage(l.key,l.params)))}return{valid:i.length===0,errors:i}}getErrorMessage(e,t){switch(e){case"required":return"This field is required";case"email":return"Invalid email address";case"min":return`Minimum ${t?.[0]} characters`;case"max":return`Maximum ${t?.[0]} characters`;case"phone":return"Invalid phone number";case"number":return"Only numbers are allowed";case"url":return"Invalid URL address";case"checked":return"You must accept";default:return"Invalid value"}}};var Lt=class{constructor(){this.domAttribute=new U;this.recordAttribute=new K;this.transformNullify=new F;this.boundingClientRect=new j;this.relativePosition=new Q(this.transformNullify);this.unitParser=new J;this.lerp=new G;this.adaptiveLerp=new Z;this.originParser=new tt;this.colorParser=new et;this.validation=new Tt;this.easingFunction=new rt;this.magneticPull=new it;this.lerpColor=new nt;this.lerpVector=new st;this.transformScaleParser=new ot;this.optionsParser=new wt;this.ruleParser=new at}};var pe=class{constructor(){this.pendingVars=new Map;this.pendingProps=new Map;this.isOpen=!1}begin(){this.isOpen||(this.isOpen=!0)}setVars(e,t){if(!this.isOpen){console.warn("StyleTxn: call begin() first to set custom properties.");return}let r=this.pendingVars.get(e)??{};for(let[i,n]of Object.entries(t))r[i]!==n&&(r[i]=n);this.pendingVars.set(e,r)}setProps(e,t){if(!this.isOpen){console.warn("StyleTxn: call begin() first to set standard properties.");return}let r=this.pendingProps.get(e)??{};for(let[i,n]of Object.entries(t))r[i]!==n&&(r[i]=n);this.pendingProps.set(e,r)}run(e){let t=this.isOpen;t||this.begin();try{e(),t||this.commit()}catch(r){throw t||this.cancel(),r}}commit(){if(this.isOpen){this.isOpen=!1;for(let[e,t]of this.pendingVars){let r=e.style;for(let[i,n]of Object.entries(t))r.setProperty(i,String(n))}this.pendingVars.clear();for(let[e,t]of this.pendingProps){let r=e.style;for(let[i,n]of Object.entries(t))r[i]=String(n)}this.pendingProps.clear()}}cancel(){this.pendingVars.clear(),this.pendingProps.clear(),this.isOpen=!1}},L=new pe;var fe=new WeakMap,I=.005;function Re(c){let e=fe.get(c);return e||(e={prevX:Number.NaN,prevY:Number.NaN},fe.set(c,e)),e}var Ot=class extends M{constructor(t){super(t);this.enterObjectsMap=new Map;this.enterObjects=new Array;this.overCount=0;this.cursorPrev={x:Number.NaN,y:Number.NaN,stepX:Number.NaN,stepY:Number.NaN};this.htmlKey="cursor",this.permissions.mobile.rebuild.height=!1,this.permissions.mobile.rebuild.width=!1,this.permissions.mobile.rebuild.scrollHeight=!1,this.cursor=document.querySelector("[string-cursor],[data-string-cursor]"),this.cursorContent=document.querySelector("[string-cursor-content],[data-string-cursor-content]"),this.attributesToMap=[...this.attributesToMap,{key:"target-disable",type:"boolean",fallback:this.settings["target-disable"]},{key:"target-style-disable",type:"boolean",fallback:this.settings["target-style-disable"]},{key:"target-class",type:"string",fallback:this.settings["target-class"]},{key:"cursor-class",type:"string",fallback:this.settings["cursor-class"]},{key:"alignment",type:{type:"enum",values:["start","center","end"]},fallback:this.settings.alignment},{key:"lerp",type:"number",fallback:this.settings.lerp,transform:r=>this.tools.adaptiveLerp.process({value:r,inMin:.1,inMax:1,outMin:.05,outMax:.65})}]}initializeObject(t,r,i,n){super.initializeObject(t,r,i,n),r.setProperty("mouse-x",0),r.setProperty("mouse-y",0),r.setProperty("mouse-pixel-x",0),r.setProperty("mouse-pixel-y",0),r.setProperty("is-mouse-over",!1),r.setProperty("is-mouse-move",!1)}onMutate(t){let r=this.data.cursor.targetX,i=this.data.cursor.targetY;if(this.objects.forEach(n=>{let o=n.getProperty("is-mouse-over"),s=n.getProperty("cursor-target-disable"),a=n.getProperty("lerp")??.15,l=n.getProperty("half-width")??n.htmlElement.offsetWidth/2,d=n.getProperty("half-height")??n.htmlElement.offsetHeight/2,p=l*2||n.htmlElement.offsetWidth||1,u=d*2||n.htmlElement.offsetHeight||1;if(o&&!s){let{cx:b,cy:m}=this.centers.getCenter(n),h=r-(b-l),v=i-(m-d),y=n.getProperty("mouse-pixel-x")??0,g=n.getProperty("mouse-pixel-y")??0,E=y-h,x=g-v;if(E*E+x*x>1e-4){(n.getProperty("is-mouse-move")??!1)||(n.setProperty("is-mouse-move",!0),n.setProperty("mouse-pixel-x",h),n.setProperty("mouse-pixel-y",v),n.setProperty("mouse-x",h),n.setProperty("mouse-y",v),y=h,g=v,this.events.emit(`cursor:start:${n.id}`,null));let f=this.tools.lerp.process({from:y,to:h,progress:a}),w=this.tools.lerp.process({from:g,to:v,progress:a}),T=y+f,P=g+w,O=Math.abs(T-y)>I||Math.abs(P-g)>I;n.setProperty("mouse-pixel-x",T),n.setProperty("mouse-pixel-y",P);let D=n.getProperty("alignment")??"center",k=this.calculateOffset(D,T,p),_=this.calculateOffset(D,P,u);n.setProperty("mouse-x",k),n.setProperty("mouse-y",_),this.setMouseCoordinates(n,k,_)&&this.events.emit(`cursor:move:${n.id}`,{x:k,y:_}),O&&this.events.emit(`cursor:pixel:${n.id}`,{x:T,y:P})}else n.setProperty("mouse-pixel-x",h),n.setProperty("mouse-pixel-y",v),n.getProperty("is-mouse-move")&&(n.setProperty("is-mouse-move",!1),this.events.emit(`cursor:end:${n.id}`,null)),this.setMouseCoordinates(n,0,0)}else{let b=n.getProperty("mouse-x")??0,m=n.getProperty("mouse-y")??0;if(b!==0||m!==0){n.setProperty("is-mouse-move",!1);let h=this.calculateOffset("center",l,p),v=this.calculateOffset("center",d,u),y=b+this.tools.lerp.process({from:b,to:h,progress:a}),g=m+this.tools.lerp.process({from:m,to:v,progress:a});n.setProperty("mouse-x",y),n.setProperty("mouse-y",g),Math.abs(y)<.001&&Math.abs(g)<.001?(n.setProperty("mouse-x",0),n.setProperty("mouse-y",0),n.setProperty("mouse-pixel-x",0),n.setProperty("mouse-pixel-y",0),this.setMouseCoordinates(n,0,0)):this.setMouseCoordinates(n,y,g)}}}),this.cursor){let{stepX:n,stepY:o,smoothedX:s,smoothedY:a}=this.data.cursor,l=this.cursorPrev;(!Number.isFinite(l.x)||Math.abs(s-l.x)>I||Math.abs(a-l.y)>I||Math.abs(n-l.stepX)>I||Math.abs(o-l.stepY)>I)&&(this.events.emit("cursor",{stepX:n,stepY:o,x:s,y:a}),this.cursor.style.setProperty("--x",s.toString()),this.cursor.style.setProperty("--y",a.toString()),this.cursor.style.setProperty("--x-lerp",n.toString()),this.cursor.style.setProperty("--y-lerp",o.toString()),this.cursorPrev={x:s,y:a,stepX:n,stepY:o})}}onObjectConnected(t){let r=t.htmlElement;t.setProperty("timeoutId",null),t.setProperty("mouseleave",()=>{this.onMouseLeave(t)}),t.setProperty("mouseenter",()=>{this.onMouseEnter(t)});let n=()=>{this.safariNavigationCleanup(t)},o=()=>{this.safariNavigationCleanup(t)};t.setProperty("beforeunload",n),t.setProperty("pagehide",o);let s=()=>{document.hidden&&t.getProperty("is-mouse-over")&&this.safariNavigationCleanup(t)};t.setProperty("visibilitychange",s);let a=new MutationObserver(l=>{l.forEach(d=>{d.type==="childList"&&d.removedNodes.length>0&&d.removedNodes.forEach(p=>{(p===r||p instanceof Element&&p.contains(r))&&this.onElementRemovedFromDOM(t)})})});r.parentNode&&a.observe(r.parentNode,{childList:!0,subtree:!0}),t.setProperty("mutationObserver",a),t.setProperty("onEnterEvent",this.onEnterObject.bind(this)),t.events.on("enter",t.getProperty("onEnterEvent")),t.setProperty("onLeaveEvent",this.onLeaveObject.bind(this)),t.events.on("leave",t.getProperty("onLeaveEvent"))}getCursorClass(t){let r=t.getProperty("cursor-class");return r!=null&&r.length>0?r:null}onMouseEnter(t){if(!document.contains(t.htmlElement))return;this.overCount++,t.setProperty("is-mouse-over",!0);let r=this.getCursorClass(t);this.cursor&&(r&&this.cursor.classList.add(r),this.cursor.classList.add("-showing"),t.setProperty("timeoutId",setTimeout(()=>{document.contains(t.htmlElement)&&(this.cursor.classList.remove("-showing"),this.cursor.classList.add("-show"))},1200))),t.htmlElement.addEventListener("mouseleave",t.getProperty("mouseleave"))}onMouseLeave(t){this.overCount--,t.setProperty("is-mouse-over",!1),t.getProperty("timeoutId")&&(clearTimeout(t.getProperty("timeoutId")),t.setProperty("timeoutId",null));let r=this.getCursorClass(t);this.cursor&&(r&&this.cursor.classList.remove(r),this.cursor.classList.remove("-showing"),this.cursor.classList.remove("-show")),document.contains(t.htmlElement)&&t.htmlElement.removeEventListener("mouseleave",t.getProperty("mouseleave"))}onEnterObject(t){t.htmlElement.addEventListener("mouseenter",t.getProperty("mouseenter")),window.addEventListener("beforeunload",t.getProperty("beforeunload")),window.addEventListener("pagehide",t.getProperty("pagehide")),document.addEventListener("visibilitychange",t.getProperty("visibilitychange"))}onLeaveObject(t){t.htmlElement.removeEventListener("mouseenter",t.getProperty("mouseenter")),t.htmlElement.removeEventListener("mouseleave",t.getProperty("mouseleave"));let r=t.getProperty("beforeunload"),i=t.getProperty("pagehide"),n=t.getProperty("visibilitychange");r&&window.removeEventListener("beforeunload",r),i&&window.removeEventListener("pagehide",i),n&&document.removeEventListener("visibilitychange",n);let o=t.getProperty("mutationObserver");o&&o.disconnect()}safariNavigationCleanup(t){t.getProperty("is-mouse-over")&&this.onMouseLeave(t)}onElementRemovedFromDOM(t){t.getProperty("is-mouse-over")&&this.onMouseLeave(t)}onObjectDisconnected(t){t.getProperty("is-mouse-over")&&this.onMouseLeave(t);let r=t.getProperty("beforeunload"),i=t.getProperty("pagehide"),n=t.getProperty("visibilitychange");r&&window.removeEventListener("beforeunload",r),i&&window.removeEventListener("pagehide",i),n&&document.removeEventListener("visibilitychange",n);let o=t.getProperty("mutationObserver");o&&o.disconnect()}setMouseCoordinates(t,r,i){if(t.getProperty("cursor-target-style-disable"))return!1;let n=Re(t),o=Math.abs(r)<I?n.prevX:Math.round(r*100)/100,s=Math.abs(i)<I?n.prevY:Math.round(i*100)/100;if(Number.isFinite(n.prevX)&&Math.abs(o-n.prevX)<=I&&Number.isFinite(n.prevY)&&Math.abs(s-n.prevY)<=I)return!1;n.prevX=o,n.prevY=s;let a=o.toFixed(2),l=s.toFixed(2);return L.run(()=>{this.applyToElementAndConnects(t,d=>{L.setVars(d,{"--x":a,"--y":l})})}),!0}calculateOffset(t,r,i){switch(t){case"start":return r/i;case"end":return(r-i)/i;case"center":default:return(r-i/2)/(i/2)}}};var kt=class extends M{constructor(e){super(e),this.htmlKey="impulse",this.attributesToMap.push({key:"position-strength",type:"number",fallback:this.settings["position-strength"]},{key:"position-tension",type:"number",fallback:this.settings["position-tension"]},{key:"position-friction",type:"number",fallback:this.settings["position-friction"]},{key:"position-max-velocity",type:"number",fallback:this.settings["position-max-velocity"]},{key:"position-update-threshold",type:"number",fallback:this.settings["position-update-threshold"]},{key:"rotation-strength",type:"number",fallback:this.settings["rotation-strength"]},{key:"rotation-tension",type:"number",fallback:this.settings["rotation-tension"]},{key:"rotation-friction",type:"number",fallback:this.settings["rotation-friction"]},{key:"rotation-max-angular-velocity",type:"number",fallback:this.settings["rotation-max-angular-velocity"]},{key:"rotation-max-angle",type:"number",fallback:this.settings["rotation-max-angle"]},{key:"rotation-update-threshold",type:"number",fallback:this.settings["rotation-update-threshold"]},{key:"max-offset",type:"number",fallback:this.settings["max-offset"]},{key:"sleep-epsilon",type:"number",fallback:this.settings["sleep-epsilon"]},{key:"continuous-push",type:"boolean",fallback:this.settings["continuous-push"]})}onObjectConnected(e){super.onObjectConnected(e),e.setProperty("offset-x",0),e.setProperty("offset-y",0),e.setProperty("velocity-x",0),e.setProperty("velocity-y",0),e.setProperty("angle-deg",0),e.setProperty("ang-vel-deg",0),e.setProperty("__prev-css-x",0),e.setProperty("__prev-css-y",0),e.setProperty("__prev-css-rot",0),e.setProperty("__push-latch",!1),this.hover.track(e),this.centers.attach(e)}onObjectDisconnected(e){this.hover.untrack(e),this.centers.detach(e)}onMouseMove(e){if(!e)return;let t=this.data.cursor.velocityX,r=this.data.cursor.velocityY;if(t===0&&r===0)return;let i=this.data.cursor.targetX,n=this.data.cursor.targetY,o=this.getElementsAtPoint(i,n);for(let s of this.objects)if(o.includes(s.htmlElement)){{let p=s.htmlElement.getBoundingClientRect(),u=p.width||1,b=Math.max(0,Math.min(1,(this.data.cursor.targetX-p.left)/u));this.events.emit(`object:impulse:${s.id}:side`,{value:b})}let l=s.getProperty("position-strength")||0;if(l!==0){let p=s.getProperty("continuous-push")??!0,u=s.getProperty("__push-latch")===!0;if(p||!u){let b=s.getProperty("velocity-x")||0,m=s.getProperty("velocity-y")||0;b+=t*l,m+=r*l,s.setProperty("velocity-x",b),s.setProperty("velocity-y",m),p||s.setProperty("__push-latch",!0)}}let d=s.getProperty("rotation-strength")??.75;if(d!==0){let{cx:p,cy:u}=this.centers.getCenter(s),b=i-p,m=n-u,h=b*r-m*t,v=s.getProperty("ang-vel-deg")||0;v+=h*d*.02,s.setProperty("ang-vel-deg",v)}}}getElementsAtPoint(e,t){return document.elementsFromPoint(e,t)}onFrame(e){let t=this.data.cursor.targetX,r=this.data.cursor.targetY,i=this.getElementsAtPoint(t,r),n=new Set(i);for(let o of this.objects)!n.has(o.htmlElement)&&o.getProperty("__push-latch")===!0&&o.setProperty("__push-latch",!1);for(let o=0;o<this.objects.length;o++){let s=this.objects[o],a=s.getProperty("offset-x")||0,l=s.getProperty("offset-y")||0,d=s.getProperty("velocity-x")||0,p=s.getProperty("velocity-y")||0,u=s.getProperty("position-tension")??.05,b=s.getProperty("position-friction")??.15,m=s.getProperty("position-max-velocity")??120,h=s.getProperty("max-offset")??220;d-=u*a,p-=u*l;let v=1-b;d*=v,p*=v,d>m?d=m:d<-m&&(d=-m),p>m?p=m:p<-m&&(p=-m),a+=d,l+=p,a>h?a=h:a<-h&&(a=-h),l>h?l=h:l<-h&&(l=-h);let y=s.getProperty("angle-deg")||0,g=s.getProperty("ang-vel-deg")||0,E=s.getProperty("rotation-tension")??.06,x=s.getProperty("rotation-friction")??.18,S=s.getProperty("rotation-max-angular-velocity")??6,C=s.getProperty("rotation-max-angle")??18;g-=E*y,g*=1-x,g>S?g=S:g<-S&&(g=-S),y+=g,y>C?(y=C,g*=.35):y<-C&&(y=-C,g*=.35);let f=s.getProperty("sleep-epsilon")??.01,w=d*d+p*p<f*f&&a*a+l*l<f*f,T=Math.abs(g)<f&&Math.abs(y)<f;w?(d||p||a||l)&&(s.setProperty("offset-x",0),s.setProperty("offset-y",0),s.setProperty("velocity-x",0),s.setProperty("velocity-y",0),a=l=d=p=0):(s.setProperty("offset-x",a),s.setProperty("offset-y",l),s.setProperty("velocity-x",d),s.setProperty("velocity-y",p)),T?(y||g)&&(s.setProperty("angle-deg",0),s.setProperty("ang-vel-deg",0),y=g=0):(s.setProperty("angle-deg",y),s.setProperty("ang-vel-deg",g));let P=s.getProperty("position-update-threshold")??.1,O=s.getProperty("rotation-update-threshold")??.15,D=s.getProperty("__prev-css-x")||0,k=s.getProperty("__prev-css-y")||0,_=s.getProperty("__prev-css-rot")||0,q=Math.round(a*10)/10,ct=Math.round(l*10)/10,pt=Math.round(y*10)/10,oe=Math.abs(q-D)>P||Math.abs(ct-k)>P,ae=Math.abs(pt-_)>O;(oe||ae)&&(this.applyToElementAndConnects(s,le=>{oe&&(le.style.setProperty("--push-x",String(q)),le.style.setProperty("--push-y",String(ct)),this.events.emit(`object:impulse:${s.id}:move`,{x:q,y:ct})),ae&&(le.style.setProperty("--push-rotation",String(pt)),this.events.emit(`object:impulse:${s.id}:rotate`,{rotation:pt}))}),oe&&(s.setProperty("__prev-css-x",q),s.setProperty("__prev-css-y",ct)),ae&&s.setProperty("__prev-css-rot",pt))}}};var It=class extends M{constructor(e){super(e),this.htmlKey="magnetic",this.permissions.mobile.rebuild.height=!1,this.permissions.mobile.rebuild.width=!1,this.permissions.mobile.rebuild.scrollHeight=!1,this.attributesToMap=[...this.attributesToMap,{key:"strength",type:"number",fallback:this.settings.strength},{key:"radius",type:"number",fallback:this.settings.radius}]}initializeObject(e,t,r,i){super.initializeObject(e,t,r,i),t.setProperty("is-magneting",!1),t.setProperty("magnetic-target-x",0),t.setProperty("magnetic-target-y",0),t.setProperty("magnetic-x",0),t.setProperty("magnetic-y",0),t.setProperty("lerp",.1)}onMouseMove(e){this.objects.forEach(t=>{let i=t.htmlElement.getBoundingClientRect(),n=i.left+i.width/2,o=i.top+i.height/2,s=e.clientX-n,a=e.clientY-o,l=Math.sqrt(s**2+a**2),d=t.getProperty("radius")??0,p=t.getProperty("strength")??0,u=this.tools.magneticPull.process({distance:l,radius:d,strength:p});t.setProperty("magnetic-target-x",s*u),t.setProperty("magnetic-target-y",a*u),u>0&&t.setProperty("is-magneting",!0)})}onFrame(e){this.objects.forEach(t=>{if(t.getProperty("is-magneting")){let r=t.getProperty("magnetic-x")??0,i=t.getProperty("magnetic-y")??0,n=t.getProperty("lerp")??0,o=t.getProperty("magnetic-target-x")??0,s=t.getProperty("magnetic-target-y")??0,a=this.tools.lerp.process({from:r,to:o,progress:n}),l=this.tools.lerp.process({from:i,to:s,progress:n});a>-.01&&a<.01&&(a=0,t.setProperty("magnetic-x",t.getProperty("magnetic-target-x"))),l>-.01&&l<.01&&(l=0,t.setProperty("magnetic-y",t.getProperty("magnetic-target-y"))),r+=a,i+=l,t.setProperty("magnetic-x",r),t.setProperty("magnetic-y",i),this.events.emit(`magnetic:move:${t.id}`,{x:r,y:i}),this.applyToElementAndConnects(t,d=>{d.style.setProperty("--magnetic-x",r.toString()),d.style.setProperty("--magnetic-y",i.toString())}),(t.getProperty("magnetic-target-x")==r||t.getProperty("magnetic-target-y")==i)&&t.setProperty("is-magneting",!1)}})}};var ue=class{constructor(){this.measureQueue=[];this.mutateQueue=[];this.scheduled=!1}measure(e){this.measureQueue.push(e),this.schedule()}mutate(e){this.mutateQueue.push(e),this.schedule()}schedule(){this.scheduled||(this.scheduled=!0,requestAnimationFrame(()=>{let e=this.measureQueue;this.measureQueue=[];for(let r=0;r<e.length;r++)try{e[r]()}catch(i){console.error("Error in frameDOM measure task:",i)}let t=this.mutateQueue;this.mutateQueue=[];for(let r=0;r<t.length;r++)try{t[r]()}catch(i){console.error("Error in frameDOM mutate task:",i)}this.scheduled=!1}))}},N=new ue;var z=class extends M{constructor(t){super(t);this.nearOnly=!0;this.useAllObjects=!1;this.maxDistanceMultiplier=1;this.updateThreshold=.1;this.objectDeltaData=new Map;this.scrollUpdateScheduled=!1}onObjectConnected(t){super.onObjectConnected(t),this.centers.attach(t),this.hover.track(t)}removeObject(t){let r=this.objectMapOnPage.get(t);r&&(this.centers.detach(r),this.hover.untrack(r)),super.removeObject(t)}onScroll(){this.centers.invalidateAll(),this.scheduleCursorUpdate()}onMouseMoveMeasure(t){super.onMouseMoveMeasure(t),this.refreshPointerState()}onMutate(t){super.onMutate(t)}getCursorTargets(){return this.nearOnly&&this.hover.activeObjects().length?this.hover.activeObjects():this.useAllObjects?this.objectsOnPage:this.objects}refreshPointerState(t){t||this.objectDeltaData.clear();let r=this.data.cursor.targetX,i=this.data.cursor.targetY,n=t?[t]:this.getCursorTargets(),o=!this.nearOnly&&this.maxDistanceMultiplier>0?Math.pow(this.maxDistanceMultiplier*this.data.viewport.windowWidth,2):null;for(let s of n){let{cx:a,cy:l}=this.centers.getCenter(s),d=r-a,p=i-l,u=d*d+p*p;this.nearOnly&&u>this.data.viewport.windowWidth*this.data.viewport.windowWidth&&!this.hover.isActive(s)||!this.nearOnly&&o!==null&&u>o||(s.setProperty("dx",d),s.setProperty("dy",p),s.setProperty("dist",Math.sqrt(u)))}}scheduleCursorUpdate(){this.scrollUpdateScheduled||(this.scrollUpdateScheduled=!0,N.mutate(()=>{this.scrollUpdateScheduled=!1,this.refreshPointerState(),L.run(()=>{this.onCursorScrollUpdate()})}))}onCursorScrollUpdate(){}};var He=Math.PI/2,de=Math.PI*2,Fe=180/Math.PI,be=c=>c<0?0:c>1?1:c,Ne=(c,e)=>{let t=(e-c)%de;return t>Math.PI&&(t-=de),t<-Math.PI&&(t+=de),c+t},We=(c,e)=>{if(e===0&&c===0)return 0;let t=Math.abs(e),r=Math.abs(c),i;if(t>=r)i=r/(t===0?1:t);else{let n=t/(r===0?1:r);i=He-n}return e<0&&(i=Math.PI-i),c<0&&(i=-i),i},ve=new WeakMap,Ve=c=>{let e=ve.get(c);return e||(e={angle:0,dist:0,tAngle:0,tDist:0,prevDeg:NaN,prevDist:NaN},ve.set(c,e)),e},Dt=class extends z{constructor(t){super(t);this.updateScheduledSpotlight=!1;this.htmlKey="spotlight",this.nearOnly=!1,this.useAllObjects=!0,this.maxDistanceMultiplier=2,this.attributesToMap.push({key:"lerp",type:"number",fallback:this.settings.lerp,transform:r=>be(this.tools.adaptiveLerp.process({value:r,inMin:.1,inMax:1,outMin:.05,outMax:.65}))},{key:"angle-threshold",type:"number",fallback:.2},{key:"distance-threshold",type:"number",fallback:.5},{key:"deadzone",type:"number",fallback:4},{key:"dist-max",type:"number",fallback:0})}onCursorFrame(t,r){}initializeObject(t,r,i,n){super.initializeObject(t,r,i,n),r.setProperty("spotlight-angle-rad",0),r.setProperty("spotlight-distance",0),r.setProperty("spotlight-angle-rad-target",0),r.setProperty("spotlight-distance-target",0),this.ensurePointerState(r),L.run(()=>{this.updateSpotlightState(r,{forceImmediate:!0,forceEmit:!0,bypassDeadzone:!0})})}onPointerDelta(t,r,i,n){}onMouseMoveMeasure(t){super.onMouseMoveMeasure(t)}onMutate(t){super.onMutate(t),this.getCursorTargets().forEach(i=>{this.updateSpotlightState(i)})}ensurePointerState(t){let r=t.getProperty("dx"),i=t.getProperty("dy"),n=t.getProperty("dist");if(r==null||i==null||n==null||!isFinite(r)||!isFinite(i)||!isFinite(n)){let{cx:o,cy:s}=this.centers.getCenter(t),a=this.data.cursor.targetX,l=this.data.cursor.targetY;r=a-o,i=l-s,n=Math.sqrt(r*r+i*i),t.setProperty("dx",r),t.setProperty("dy",i),t.setProperty("dist",n)}}updateSpotlightState(t,r={}){this.ensurePointerState(t);let i=Ve(t),n=t.getProperty("dx")??0,o=t.getProperty("dy")??0,s=t.getProperty("dist")??0,a=t.getProperty("deadzone")??4;(r.bypassDeadzone||s>a)&&(i.tAngle=We(o,n));let l=t.getProperty("dist-max")??0,d=l>0?Math.min(s,l):s;if(i.tDist=d,t.setProperty("spotlight-distance-target",i.tDist),t.setProperty("spotlight-angle-rad-target",i.tAngle),r.forceImmediate)i.angle=i.tAngle,i.dist=i.tDist;else{let v=be(t.getProperty("lerp")??.15),y=Ne(i.angle,i.tAngle);i.angle+=(y-i.angle)*v,i.dist+=(i.tDist-i.dist)*v}t.setProperty("spotlight-angle-rad",i.angle),t.setProperty("spotlight-distance",i.dist);let p=i.angle*Fe-90,u=t.getProperty("angle-threshold")??.2,b=t.getProperty("distance-threshold")??.5,m=r.forceEmit||isNaN(i.prevDeg)||Math.abs(p-i.prevDeg)>u,h=r.forceEmit||isNaN(i.prevDist)||Math.abs(i.dist-i.prevDist)>b;if(m||h){let v=Math.round(p*10)/10,y=Math.round(i.dist*10)/10;this.applyToElementAndConnects(t,g=>{L.setVars(g,{"--spotlight-angle":String(v),"--spotlight-angle-deg":`${v}deg`,"--spotlight-distance":String(y)})}),i.prevDeg=p,i.prevDist=i.dist,this.events.emit(`spotlight:update:${t.id}`,{distance:y,angleDeg:v})}}onCursorScrollUpdate(){this.getCursorTargets().forEach(r=>{this.updateSpotlightState(r,{bypassDeadzone:!0})})}};var At=class extends M{constructor(t){super(t);this.isStartLoaded=!1;this.loadingCount=0;this.imageStates=new WeakMap;this.htmlKey="lazy"}onInit(){document.querySelectorAll("img[string-lazy], img[data-string-lazy]").forEach(r=>this.prepareAspectRatio(r)),this.isStartLoaded=!0}onObjectConnected(t){let r=t.htmlElement;if(!(r instanceof HTMLImageElement))return;let i=this.ensureState(r);this.prepareAspectRatio(r);let n=o=>{this.handleInView(r,i,!!o?.inView)};i.unsubscribe&&i.unsubscribe(),this.events.on(`object:inview:${t.id}`,n),i.unsubscribe=()=>this.events.off(`object:inview:${t.id}`,n),this.isStartLoaded&&(t.getProperty("is-inview")??!1)&&this.handleInView(r,i,!0)}onObjectDisconnected(t){let r=t.htmlElement;if(!(r instanceof HTMLImageElement))return;let i=this.imageStates.get(r);i&&(i.pendingActivation=!1,i.unsubscribe&&(i.unsubscribe(),i.unsubscribe=void 0))}ensureState(t){let r=this.imageStates.get(t);if(!r){let i=this.readSource(t);return r={src:i,aspectReady:!1,contentReady:!1,aspectLoading:!1,contentLoading:!1,pendingActivation:!1},this.imageStates.set(t,r),t.classList.contains("lazyLoad")||t.classList.add("lazyLoad"),t.dataset&&!t.dataset.stringLazySrc&&i&&(t.dataset.stringLazySrc=i),r}return r.src||(r.src=this.readSource(t)),r}readSource(t){let r=this.tools.domAttribute.process({element:t,key:this.htmlKey,fallback:""});return typeof r=="string"?r:r==null?"":String(r)}prepareAspectRatio(t){let r=this.ensureState(t);if(!r.src||r.aspectLoading||r.aspectReady)return;r.aspectLoading=!0;let i=t.getAttribute("crossorigin"),n=t.getAttribute("referrerpolicy");r.aspectPromise=this.loadIntrinsicSize(r.src,i,n).then(({width:o,height:s})=>{o>0&&s>0&&(t.style.aspectRatio=`${o} / ${s}`,r.width=o,r.height=s),r.aspectReady=!0,r.aspectLoading=!1,this.maybeActivateImage(t,r)}).catch(o=>{console.warn("Failed to read image size for lazy image:",r.src,o),r.aspectLoading=!1})}loadIntrinsicSize(t,r,i){return new Promise((n,o)=>{let s=new Image;r!==null&&(s.crossOrigin=r),i!==null&&(s.referrerPolicy=i),s.decoding="async";let a=()=>{s.removeEventListener("load",l),s.removeEventListener("error",d)},l=()=>{a(),n({width:s.naturalWidth,height:s.naturalHeight})},d=()=>{a(),o(new Error("Image failed to preload"))};s.addEventListener("load",l),s.addEventListener("error",d),s.src=t,s.complete&&s.naturalWidth>0&&s.naturalHeight>0&&(a(),n({width:s.naturalWidth,height:s.naturalHeight}))})}handleInView(t,r,i){if(r.pendingActivation=i,!!i){if(!r.aspectReady){r.aspectLoading||this.prepareAspectRatio(t);return}this.maybeActivateImage(t,r)}}maybeActivateImage(t,r){!r.pendingActivation||r.contentReady||r.contentLoading||!r.aspectReady||!r.src||this.activateImage(t,r)}activateImage(t,r){r.contentLoading=!0,this.loadingCount++;let i=s=>{r.contentLoading&&(r.contentLoading=!1,r.pendingActivation=!1,this.loadingCount=Math.max(0,this.loadingCount-1),s&&(r.contentReady=!0,t.classList.add("-loaded")),this.loadingCount===0&&this.events.emit("image:load:all",null))},n=()=>i(!0),o=()=>{console.warn("Lazy image failed to load:",r.src),i(!1)};t.addEventListener("load",n,{once:!0}),t.addEventListener("error",o,{once:!0}),t.src=r.src,t.complete&&t.naturalWidth>0&&t.naturalHeight>0&&(t.removeEventListener("load",n),t.removeEventListener("error",o),i(!0))}};var Rt=class extends M{constructor(t){super(t);this.loadingTimeout=0;this._type=2,this.loadingTimeout=this.settings.timeout}onInit(){setTimeout(()=>{document.documentElement.classList.add("-loaded")},this.loadingTimeout)}};var Ht=class extends M{constructor(e){super(e),this.htmlKey=""}canConnect(e){return e.keys[0]==null}};var $=class{constructor(e){this.min=void 0;this.max=void 0;this.enable=!0;this.min=e?.min,this.max=e?.max,this.enable=e?.enable??!0}setEnable(e=!0){this.enable=e}setRange(e,t){this.min=e??void 0,this.max=t??void 0}get mediaQuery(){let e="screen";return this.min&&(e+=` and (min-width: ${this.min}px)`),this.max&&(e+=` and (max-width: ${this.max}px)`),e}},Ft=class extends M{constructor(t){super(t);this.queries={0:new $({max:359}),1:new $({min:360,max:1079}),2:new $({min:1080,max:1365}),3:new $({min:1366})};this.isMobileMedia=!1;this.isTabletMedia=!1;this.isLaptopMedia=!1;this.isDesktopMedia=!1;this.matchMedias={0:window.matchMedia(this.queries[0].mediaQuery),1:window.matchMedia(this.queries[1].mediaQuery),2:window.matchMedia(this.queries[2].mediaQuery),3:window.matchMedia(this.queries[3].mediaQuery)};this._type=2}onConnect(){}onInit(){if(this.settings!=null&&this.settings.settings!=null){let t=this.settings.settings;t.mobile?(this.queries[0].enable=!0,this.queries[0].setRange(t.mobile.min==null?null:t.mobile.min,t.mobile.max??null),this.matchMedias[0]=window.matchMedia(this.queries[0].mediaQuery)):this.queries[0].enable=!1,t.tablet?(this.queries[1].enable=!0,this.queries[1].setRange(t.tablet.min==null?null:t.tablet.min,t.tablet.max??null),this.matchMedias[1]=window.matchMedia(this.queries[1].mediaQuery)):this.queries[1].enable=!1,t.laptop?(this.queries[2].enable=!0,this.queries[2].setRange(t.laptop.min==null?null:t.laptop.min,t.laptop.max??null),this.matchMedias[2]=window.matchMedia(this.queries[2].mediaQuery)):this.queries[2].enable=!1,t.desktop?(this.queries[3].enable=!0,this.queries[3].setRange(t.desktop.min==null?null:t.desktop.min,t.desktop.max??null),this.matchMedias[3]=window.matchMedia(this.queries[3].mediaQuery)):this.queries[3].enable=!1}this.updateElements()}onResize(){this.updateElements()}updateElements(){let t=this.matchMedias[0].matches&&this.queries[0].enable,r=this.matchMedias[1].matches&&this.queries[1].enable,i=this.matchMedias[2].matches&&this.queries[2].enable,n=this.matchMedias[3].matches&&this.queries[3].enable;this.isMobileMedia!=t&&this.events.emit("screen:mobile",t),this.isTabletMedia!=r&&this.events.emit("screen:tablet",r),this.isLaptopMedia!=i&&this.events.emit("screen:laptop",i),this.isDesktopMedia!=n&&this.events.emit("screen:desktop",n),this.isMobileMedia=t,this.isTabletMedia=r,this.isLaptopMedia=i,this.isDesktopMedia=n,document.querySelectorAll("[string-mobile], [string-tablet], [string-laptop], [string-desktop]").forEach(s=>{let a=!1;s.hasAttribute("string-mobile")&&t&&(a=!0),s.hasAttribute("string-tablet")&&r&&(a=!0),s.hasAttribute("string-laptop")&&i&&(a=!0),s.hasAttribute("string-desktop")&&n&&(a=!0),a?s.style.display=null:s.style.display="none"})}};var Nt=class extends M{constructor(e){super(e),this.htmlKey="anchor",this.attributesToMap=[...this.attributesToMap,{key:"anchor",type:"tuple",fallback:this.settings.anchor,transform:t=>{let[r,i]=t,n=this.tools.originParser.process({value:r}),o=this.tools.originParser.process({value:i});return{x:n,y:o}}}]}onObjectConnected(e){super.onObjectConnected(e);let t=e.getProperty("anchor");t&&this.applyToElementAndConnects(e,r=>{r.style.transformOrigin=`${t.x} ${t.y}`})}};var Be=.05,ze=.01,ye=1,$e=-1,Ye=1,Wt=class extends M{constructor(t){super(t);this.previousLerp=0;this.displacement=0;this.acceleration=0;this.velocityMultiplier=.00125;this.isInitialScroll=!0;this.baseVelocityMultiplier=.00125;this.reducedVelocityMultiplier=this.baseVelocityMultiplier/20;this.negativeVelocityMultiplier=-1e-4;this.maxDisplacementValue=0;this.setupItem=t=>{let r=t.getProperty("glide")??0,i=-this.data.scroll.displacement*this.maxDisplacementValue*r;this.events.emit(`object:glide:${t.id}`,i);let n=`translate3d(0, ${i}px, 0)`;t.htmlElement.style.transform=n};this.onUpdateDesktopEvent=()=>{for(let t=0;t<this.objects.length;t++){let r=this.objects[t];this.setupItem(r)}};this.onUpdateMobileEvent=()=>{};this.onUpdateEvent=this.onUpdateDesktopEvent;this.htmlKey="glide",this.baseVelocityMultiplier=this.settings["glide-base-velocity"]??this.baseVelocityMultiplier,this.reducedVelocityMultiplier=this.settings["glide-reduce-velocity"]??this.reducedVelocityMultiplier,this.negativeVelocityMultiplier=this.settings["glide-negative-velocity"]??this.negativeVelocityMultiplier,this.attributesToMap=[...this.attributesToMap,{key:"glide",type:"number",fallback:this.settings.glide}]}calcExpanderFactor(t){let r=t?this.data.scroll.lerped<this.previousLerp:this.data.scroll.lerped>this.previousLerp;this.velocityMultiplier=r?this.isInitialScroll?this.baseVelocityMultiplier:this.reducedVelocityMultiplier:this.negativeVelocityMultiplier,r||(this.isInitialScroll=!1)}onStart(){this.maxDisplacementValue=this.data.viewport.windowHeight*.1}onResize(){window.innerWidth>1080?(this.maxDisplacementValue=this.data.viewport.windowHeight*.1,this.onUpdateEvent=this.onUpdateDesktopEvent):(this.onUpdateEvent=this.onUpdateMobileEvent,this.resetState(),this.objects.forEach(t=>{this.setupItem(t)}))}resetState(){this.displacement=0,this.acceleration=0,this.isInitialScroll=!0,this.velocityMultiplier=this.baseVelocityMultiplier}onScrollStart(){this.resetState()}onScrollStop(){this.resetState(),this.previousLerp=0;for(let t=0;t<this.objects.length;t++){let r=this.objects[t],i="translate3d(0, 0px, 0)";r.htmlElement.style.transform=i,r.htmlElement.style.setProperty("--glide",this.data.scroll.displacement.toString())}}onFrame(t){this.calcExpanderFactor(this.data.scroll.isScrollingDown===!1),this.acceleration=Math.min(ye,this.acceleration+Be),this.displacement=Math.max(ze,Math.min(ye,this.displacement+this.velocityMultiplier)),this.data.scroll.displacement=Math.min(Ye,Math.max($e,this.data.scroll.lerped*this.displacement*this.acceleration)),this.objects.forEach(r=>{this.applyToElementAndConnects(r,i=>{i.style.setProperty("--glide",this.data.scroll.displacement.toString())})}),this.previousLerp=this.data.scroll.lerped,this.onUpdateEvent()}};var Vt=class extends M{constructor(e){super(e),this.htmlKey="lerp"}onScrollStop(){this.objects.forEach(e=>{this.setLerpValue(e,0)})}onFrame(e){let t=e.scroll.lerped;this.objects.forEach(r=>{this.setLerpValue(r,t)})}setLerpValue(e,t){this.events.emit(`object:lerp:${e.id}`,t),e.htmlElement.style.setProperty("--lerp",t.toString())}};var Bt=class Bt extends M{constructor(t){super(t);this.updateScheduled=!1;this.htmlKey="progress",this.attributesToMap=[...this.attributesToMap,{key:"easing",type:"easing",fallback:this.settings.easing}]}initializeObject(t,r,i,n){super.initializeObject(t,r,i,n)}recomputeProgress(t){let r=t.getProperty("start-position")??0,i=t.getProperty("difference-position")??0,n=0;n=Math.min(1,Math.max(0,(this.data.scroll.transformedCurrent-r)/i)),t.setProperty("progress-raw",n);let o=t.getProperty("easing"),s=typeof o=="function"?o(n):n;this.applyProgressValue(t,s)}applyProgressValue(t,r){t.setProperty("progress",r)}calculatePositions(t,r){super.calculatePositions(t,r),this.recomputeProgress(t)}onScroll(t){super.onScroll(t)}onObjectConnected(t){super.onObjectConnected(t)}onScrollMeasure(t){this.objects.forEach(r=>{this.recomputeProgress(r)})}onMutate(){this.objects.forEach(t=>{this.updateObjectProgress(t)})}updateObjectProgress(t){let r=t.getProperty("key"),i=t.getProperty("progress");if(typeof i!="number"||!Number.isFinite(i))return;let n=t.getProperty("progress-raw")??i,o=i.toString(),s=t.getProperty("easing"),a=t.getProperty("progress-emitted");this.hasProgressChanged(a,i)&&(t.setProperty("progress-emitted",i),this.events.emit(`object:progress:${t.id}`,i),this.applyToElementAndConnects(t,l=>{r&&L.setVars(l,{[r]:o})},(l,d)=>{if(!d)return;let p=d.applyProgress(n,typeof s=="function"?s:void 0);d.setProperty("progress",p),r&&L.setVars(l,{[r]:p.toString()})}))}hasProgressChanged(t,r){return t===null?!0:Math.abs(t-r)>Bt.PROGRESS_EPSILON}onObjectDisconnected(t){super.onObjectDisconnected(t);let r=t.getProperty("key");if(!r)return;let i=n=>{n.style.removeProperty(r)};i(t.htmlElement),t.mirrorObjects.forEach(n=>{i(n.htmlElement)})}};Bt.PROGRESS_EPSILON=1e-4;var Y=Bt;var zt=class extends Y{constructor(t){super(t);this.updateScheduledTransform=!1;this.calculateDesktopParallax=t=>{let r=t.getProperty("progress")??0,i=t.getProperty("parallax")??0,n=t.getProperty("parallax-position-start")??0,o=t.getProperty("parallax-position-end")??1,s=t.getProperty("parallax-sign")??1,a=this.data.viewport.windowHeight/this.data.viewport.transformScale,l=s*i*(a*n+r*a*o);return this.events.emit(`object:parallax:${t.id}`,l),{transform:`translate3d(0, ${l}px, 0)`}};this.calculateMobileParallax=t=>(this.events.emit(`object:parallax:${t.id}`,0),{transform:"translate3d(0, 0px, 0)"});this.htmlKey="parallax",this.attributesToMap=[...this.attributesToMap,{key:"parallax",type:"number",fallback:this.settings.parallax},{key:"parallax-bias",type:"number",fallback:this.settings["parallax-bias"]}],this.calculateParallaxForObject=this.calculateDesktopParallax}initializeObject(t,r,i,n){super.initializeObject(t,r,i,n);let o=r.getProperty("parallax-bias")??0,s=Math.abs(r.getProperty("parallax")??.2);r.setProperty("parallax-sign",Math.sign(r.getProperty("parallax"))),r.setProperty("parallax",s),r.setProperty("parallax-position-start",-.5+.5*o),r.setProperty("parallax-position-end",.5+.5*(1-o));let a=this.data.viewport.windowHeight;r.setProperty("offset-top",s*a),r.setProperty("offset-bottom",s*a)}calculatePositions(t,r){super.calculatePositions(t,r),t.setProperty("transform-value",this.calculateParallaxForObject(t))}onScroll(t){super.onScroll(t)}onResize(){let t=window.innerWidth>1080;this.calculateParallaxForObject=t?this.calculateDesktopParallax:this.calculateMobileParallax}onScrollMeasure(t){super.onScrollMeasure(t),this.objects.forEach(r=>{r.setProperty("transform-value",this.calculateParallaxForObject(r))})}onMutate(){this.objects.forEach(t=>{let r=t.getProperty("transform-value");this.applyToElementAndConnects(t,i=>{L.setProps(i,r)})})}};var $t=class{constructor(e,t,r){this.isDragging=!1;this.startY=0;this.startScrollPosition=0;this.data=e,this.scrollbar=t,this.thumb=r}onResize(){let e=this.data.viewport.contentWidth,t=this.data.viewport.windowWidth,r=t/e*t;this.thumb.style.setProperty("--size",r+"px"),e<=t?this.scrollbar.classList.add("-hide"):this.scrollbar.classList.remove("-hide")}updateThumb(){let e=this.data.viewport.contentWidth,t=this.data.viewport.windowWidth;this.thumb.style.setProperty("--position",`${this.data.scroll.current/e*t+"px"}`)}mouseDownEvent(e){this.startY=e.clientY,this.startScrollPosition=this.data.scroll.current}mouseMoveEvent(e){let t=e.clientY-this.startY,r=this.startScrollPosition+t/this.data.viewport.windowWidth*this.data.viewport.contentWidth;this.data.scroll.current=r,this.data.scroll.target=r,window.scrollTo(0,r),this.updateThumb()}};var Yt=class{constructor(e,t,r){this.isDragging=!1;this.startCoordinate=0;this.startScrollPosition=0;this.data=e,this.scrollbar=t,this.thumb=r}onResize(){let e=this.data.viewport.contentHeight,t=this.data.viewport.windowHeight,r=t/e*t;this.thumb.style.setProperty("--height",r+"px"),e<=t?this.scrollbar.classList.add("-hide"):this.scrollbar.classList.remove("-hide")}updateThumb(){let e=this.data.viewport.contentHeight,t=this.data.viewport.windowHeight;this.thumb.style.setProperty("--position",`${this.data.scroll.current/e*t+"px"}`)}mouseDownEvent(e){this.startCoordinate=e.clientY,this.startScrollPosition=this.data.scroll.current}mouseMoveEvent(e){let t=e.clientY-this.startCoordinate,r=this.startScrollPosition+t/this.data.viewport.windowHeight*this.data.viewport.contentHeight,i=this.data.scroll.bottomPosition,n=Math.max(0,Math.min(r,i));this.data.scroll.current=n,this.data.scroll.target=n,window.scrollTo(0,n),this.updateThumb()}};var _t=class extends M{constructor(t){super(t);this.isDragging=!1;this.scrollMode="smooth";this.mouseUpEventBind=this.mouseUpEvent.bind(this),this.mouseDownEventBind=this.mouseDownEvent.bind(this),this.mouseMoveEventBind=this.mouseMoveEvent.bind(this)}destructor(){document.removeEventListener("mouseup",this.mouseUpEventBind),this.thumb.removeEventListener("mousedown",this.mouseDownEventBind),document.removeEventListener("mousemove",this.mouseMoveEventBind)}onInit(){this.createScrollbar(),this.updateThumb(),this.addCustomStyles(),document.addEventListener("mouseup",this.mouseUpEventBind),this.thumb.addEventListener("mousedown",this.mouseDownEventBind),document.addEventListener("mousemove",this.mouseMoveEventBind),document.documentElement.classList.add("-no-scrollbar")}onScroll(t){this.updateThumb(),this.showScrollbar(),this.hideScrollbar()}onResize(){this.scrollbarState.onResize()}addCustomStyles(){let t=document.createElement("style");t.textContent=`
|
|
2
2
|
::-webkit-scrollbar {
|
|
3
3
|
display: none;
|
|
4
4
|
width: 0;
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
-ms-overflow-style: none; /* IE and Edge */
|
|
17
17
|
scrollbar-width: none; /* Firefox */
|
|
18
18
|
}
|
|
19
|
-
`,document.head.appendChild(e)}createScrollbar(){this.scrollbar=document.createElement("div"),this.scrollbar.classList.add("scrollbar"),this.thumb=document.createElement("div"),this.thumb.classList.add("thumb"),this.scrollbar.appendChild(this.thumb),document.body.appendChild(this.scrollbar),this.scrollbarStateHorizontal=new Lt(this.data,this.scrollbar,this.thumb),this.scrollbarStateVertical=new Ot(this.data,this.scrollbar,this.thumb),this.scrollbarState=this.scrollbarStateVertical}updateThumb(){this.scrollbarState.updateThumb()}mouseDownEvent(e){this.isDragging=!0,this.scrollbarState.mouseDownEvent(e),document.body.style.userSelect="none",this.scrollbar.classList.add("-touch")}mouseMoveEvent(e){this.isDragging&&this.scrollbarState.mouseMoveEvent(e)}mouseUpEvent(){this.isDragging=!1,document.body.style.userSelect="",this.hideScrollbar(),this.scrollbar.classList.remove("-touch")}showScrollbar(){this.scrollbar.classList.add("-scroll")}hideScrollbar(){this.scrollTimeout&&clearTimeout(this.scrollTimeout),this.scrollTimeout=setTimeout(()=>{this.scrollbar.classList.remove("-scroll")},1e3)}};var R={BEFORE_ELEMENT:"-before-element",AFTER_ELEMENT:"-after-element"};function re(c,t){let e=document.createDocumentFragment(),r=0,i=P(t,"line")||P(t,"charLine")||P(t,"wordLine"),o=0;return c.forEach(s=>{o+=s.words.length}),o--,c.forEach((s,n)=>{let a=n===c.length-1,l=e;i&&(l=document.createElement("span"),l?.setAttribute("aria-hidden","true"),l.classList.add("-s-line"),s.isBeforeElement&&l.classList.add(R.BEFORE_ELEMENT),s.isAfterElement&&l.classList.add(R.AFTER_ELEMENT),l.style.setProperty("--line-index",String(s.lineIndex)),l.style.setProperty("--word-total",String(s.words.length)),Zt(l,s.calculatedValues,t)),s.words.forEach((u,p)=>{i&&(o=s.words.length-1);let d=p===o;if(u.chars.length===1&&u.chars[0].token.type==="element"){let b=u.chars[0].token.node.cloneNode(!0);l.appendChild(b),d||l.appendChild(document.createTextNode("\xA0"));return}let g=P(t,"word")||P(t,"charWord")||P(t,"wordLine"),m=g?document.createElement("span"):l;if(g&&(m?.setAttribute("aria-hidden","true"),m.classList.add("-s-word"),u.isBeforeElement&&m.classList.add(R.BEFORE_ELEMENT),u.isAfterElement&&m.classList.add(R.AFTER_ELEMENT),m.style.setProperty("--word-index",String(u.wordIndexGlobal)),m.style.setProperty("--char-total",String(u.chars.length)),Zt(m,u.calculatedValues,t)),P(t,"char")||P(t,"charLine")||P(t,"charWord"))u.chars.forEach(b=>{if(b.char===" "||b.char===" ")return;let M=document.createElement("span");M?.setAttribute("aria-hidden","true");let y=M;y.classList.add("-s-char"),b.isBeforeElement&&y.classList.add(R.BEFORE_ELEMENT),b.isAfterElement&&y.classList.add(R.AFTER_ELEMENT),y.textContent=b.char,y.style.setProperty("--char-index",String(r++)),Zt(y,b.calculatedValues,t),m.appendChild(M)});else{let b=document.createTextNode(u.chars.map(M=>M.char).join(""));m.appendChild(b)}g&&l.appendChild(m),i?d?a||l.appendChild(document.createElement("br")):m.appendChild(document.createTextNode("\xA0")):d||m.appendChild(document.createTextNode("\xA0"))}),i&&e.appendChild(l)}),e}function Zt(c,t,e){if(t)for(let r of t){if(!Se(r.type,r.align,e))continue;let i=Me(r.type,r.align);c.style.setProperty(i,String(r.value))}}function Se(c,t,e){let r=e[c]??[];return Array.isArray(r)&&r.some(i=>t.startsWith("random")?i.align.startsWith("random"):i.align===t)}function Me(c,t){let e=t.startsWith("random")?"random":t;return`--${c}-${e}`}function P(c,t){return Array.isArray(c[t])&&c[t].length>0}var et=0;function ie(c){et=0;let t=[];return c.forEach(e=>{if(e.nodeType===Node.ELEMENT_NODE){let r=e;if(r.tagName.toLowerCase()==="br"){t.push({type:"br",id:`br_${et++}`,node:r,tagName:"br"});return}t.push({type:"element",id:`el_${et++}`,node:r,tagName:r.tagName.toLowerCase()})}else if(e.nodeType===Node.TEXT_NODE){let r=e.nodeValue??"",i=`text_${et++}`;r.trim()?t.push({type:"text",id:i,node:e,content:r}):t.push({type:"space",id:i,node:e,content:r})}else t.push({type:"other",id:`node_${et++}`,node:e})}),t}function xe(c){let t=[],e=[];for(let r of c)r.type==="br"?(e.length&&t.push(e),t.push([r]),e=[]):e.push(r);return e.length&&t.push(e),t}function oe(c,t){let e=document.createElement("div"),r=window.getComputedStyle(t);e.style.position="absolute",e.style.visibility="hidden",e.style.pointerEvents="none",e.style.width=t.clientWidth+"px",e.style.padding=r.padding,e.style.font=r.font,e.style.letterSpacing=r.letterSpacing,e.style.lineHeight=r.lineHeight,e.style.fontVariant=r.fontVariant,e.style.fontStretch=r.fontStretch;let i=document.createElement("span");i.textContent="\xA0",e.appendChild(i);let o=i.getBoundingClientRect().width;e.removeChild(i),e.style.width=t.clientWidth+o+"px",t.appendChild(e);let s=[],n=xe(c),a=!1;for(let l of n){if(l.length===1&&l[0].type==="br"){s.push({token:l[0],rect:new DOMRect(0,0,0,0)});continue}l.length!==0&&(e.innerHTML="",l.forEach((u,p)=>{let d,g,m;switch(u.type){case"text":u.content.trim().split(/\s+/).filter(M=>M.length>0).forEach((M,y)=>{g=document.createElement("span"),g.style.display="inline-block",g.textContent=M+"\xA0",e.appendChild(g),m=g.getBoundingClientRect();let v={token:{type:"text",id:"",node:d,content:M},rect:m};a&&(a=!1,v.token.meta={...v.token.meta||{},isAfterElement:!0}),s.push(v)});break;case"element":d=u.node.cloneNode(!0),g=document.createElement("span"),g.style.display="inline-block",g.appendChild(d),e.appendChild(g),m=g.getBoundingClientRect(),s.push({token:u,rect:m});let b=s[s.length-2];b?.token.type==="text"&&(b.token.meta={...b.token.meta||{},isBeforeElement:!0}),a=!0;break;case"space":case"other":break}}))}return t.removeChild(e),s}var se=1;function ae(c){let t=[],e=null,r=0,i=0,o=0;return c.forEach(s=>{let n=s.token,a=n.meta?.isBeforeElement??!1,l=n.meta?.isAfterElement??!1;if(n.type==="br"){e=null;return}if(n.type==="text"){let u=n.content.match(/(\s+|\S+)/g);if(!u)return;let p=s.rect.left,d=n.content.length,g=d>0?s.rect.width/d:0;u.forEach(m=>{if(/^\s+$/.test(m)){p+=g*m.length;return}let h=[];if(m.split("").forEach((x,S)=>{let E=new DOMRect(p,s.rect.top,g,s.rect.height);h.push({char:x,rect:E,token:n,charIndexInWord:S,charIndexInLine:0,charIndexGlobal:i++}),p+=g}),h.length>0){let x=h[h.length-1];a&&(x.isBeforeElement=!0),l&&(x.isAfterElement=!0)}if((!e||Math.abs(s.rect.top-r)>se)&&(r=s.rect.top,e={words:[],rect:s.rect,lineIndex:t.length},t.push(e)),!e)return;let M=e.words.length,y=e.words.reduce((x,S)=>x+S.chars.length,0);h.forEach((x,S)=>x.charIndexInLine=y+S);let v={chars:h,rect:s.rect,wordIndexGlobal:o++,wordIndexInLine:M,isBeforeElement:a,isAfterElement:l};e.words.push(v),e.rect=ne(e.words.map(x=>x.rect)),a&&(e.isBeforeElement=!0),l&&(e.isAfterElement=!0)})}else if(n.type==="element"){let u=s.rect;if((!e||Math.abs(u.top-r)>se)&&(r=u.top,e={words:[],rect:u,lineIndex:t.length},t.push(e)),!e)return;let d=e.words.length,g=e.words.reduce((b,M)=>b+M.chars.length,0),h={chars:[{char:"[E]",rect:u,token:n,charIndexInWord:0,charIndexInLine:g,charIndexGlobal:i++}],rect:u,wordIndexGlobal:o++,wordIndexInLine:d,isBeforeElement:!1,isAfterElement:!1};e.words.push(h),e.rect=ne(e.words.map(b=>b.rect))}}),t}function ne(c){let t=Math.min(...c.map(o=>o.left)),e=Math.min(...c.map(o=>o.top)),r=Math.max(...c.map(o=>o.right)),i=Math.max(...c.map(o=>o.bottom));return new DOMRect(t,e,r-t,i-e)}var It=class extends f{constructor(t){super(t),this.htmlKey="split",this.permissions.mobile.rebuild.height=!1,this.permissions.mobile.rebuild.width=!1}onResizeWidth(){this.objectsOnPage.forEach(t=>{this.onObjectConnected(t)})}onObjectConnected(t){let e=t.htmlElement;if(!e)return;let r=e.classList.contains("-splitted"),i=e.getAttribute("string-split-original");(!r||i===null)&&(i=this.escapeAttribute(e.innerHTML),e.setAttribute("string-split-original",i),e.classList.add("-splitted")),t.htmlElement.innerHTML=i;let o=e.getAttribute("string-split")??e.getAttribute("data-string-split")??"",s=this.tools.optionsParser.process({attributeValue:o}),{fragment:n,result:a}=this.split(e,s);t.setProperty("nodes",n.childNodes),e.setAttribute("aria-label",i),e.innerHTML="",e.appendChild(a);let l=e.getAttribute("string-split-restore-after");l&&!isNaN(Number(l))&&setTimeout(()=>{e.innerHTML=i,e.classList.add("-restored")},Number(l))}split(t,e){let r=document.createDocumentFragment();t.childNodes.forEach(a=>r.appendChild(a.cloneNode(!0)));let i=ie(r.childNodes),o=oe(i,t),s=ae(o);this.applyCalculatedValues(s,e);let n=re(s,e);return{fragment:r,result:n}}computeValue(t,e,r){if(t.align.startsWith("random")){let i=t.random?.min??0,o=t.random?.max??r-1;return Math.floor(Math.random()*(o-i+1))+i}switch(t.align){case"start":return e;case"end":return r-e-1;case"center":{let i=Math.floor((r-1)/2);return Math.abs(e-i)}default:return e}}applyCalculatedValues(t,e){let r=s=>s.words.reduce((n,a)=>n+a.chars.length,0),i=t.reduce((s,n)=>s+n.words.length,0),o=t.reduce((s,n)=>s+n.words.reduce((a,l)=>a+l.chars.length,0),0);t.forEach((s,n)=>{e.line&&(s.calculatedValues=e.line.map(a=>({type:"line",align:a.align,value:this.computeValue(a,n,t.length)}))),s.words.forEach((a,l)=>{e.word&&(a.calculatedValues=e.word.map(p=>({type:"word",align:p.align,value:this.computeValue(p,a.wordIndexGlobal,i)}))),e.wordLine&&(a.calculatedValues??(a.calculatedValues=[]),a.calculatedValues.push(...e.wordLine.map(p=>({type:"wordLine",align:p.align,value:this.computeValue(p,a.wordIndexInLine,s.words.length)}))));let u=r(s);a.chars.forEach(p=>{let d=[];e.char&&d.push(...e.char.map(g=>({type:"char",align:g.align,value:this.computeValue(g,p.charIndexGlobal,o)}))),e.charWord&&d.push(...e.charWord.map(g=>({type:"charWord",align:g.align,value:this.computeValue(g,p.charIndexInWord,a.chars.length)}))),e.charLine&&d.push(...e.charLine.map(g=>({type:"charLine",align:g.align,value:this.computeValue(g,p.charIndexInLine,u)}))),p.calculatedValues=d})})})}escapeAttribute(t){return t.replace(/src="(https?:\/\/[^"\s]+)"/g,"src=$1")}};var Dt=class extends f{constructor(e){super(e);this.history=[];this.maxPoints=0;this.height=0;this.value=0;this.target=0;this._type=2}onInit(){this.initCanvas(),this.maxPoints=this.canvas.width}onScroll(e){let r=Math.abs(e.scroll.displacement);this.value=r,this.history.push(r),this.history.length>this.maxPoints&&this.history.shift(),this.draw()}draw(){let e=this.context,r=this.canvas.width,i=this.canvas.height;e.clearRect(0,0,r,i),e.strokeStyle="red",e.lineWidth=2,e.beginPath(),this.history.forEach((o,s)=>{let n=s,a=i-o*this.height;s===0?e.moveTo(n,a):e.lineTo(n,a)}),e.stroke()}initCanvas(){let e=document.createElement("canvas"),r=window.innerWidth*.5;this.height=window.innerHeight/15-20,e.width=r,e.height=this.height,Object.assign(e.style,{position:"fixed",bottom:`${window.innerHeight/20+10}px`,left:"50%",transform:"translateX(-50%)",backgroundColor:"#000000",border:"1px solid rgba(255, 255, 255, 0.2)",zIndex:"1000",pointerEvents:"none"}),this.canvas=e,this.context=e.getContext("2d"),document.body.appendChild(e)}setTarget(e){this.target=e}clear(){this.canvas.remove(),this.history=[]}};var Rt=class extends f{constructor(e){super(e);this.frameCount=0;this._type=2}onInit(){this.createDisplayElement(),this.intervalId=window.setInterval(()=>{this.displayElement.textContent=`FPS: ${this.frameCount}`,this.frameCount=0},1e3)}onFrame(e){this.frameCount++}destroy(){clearInterval(this.intervalId),this.displayElement.remove()}createDisplayElement(){let e=document.createElement("div");Object.assign(e.style,{position:"fixed",bottom:"10px",right:"10px",backgroundColor:"#000",color:"#fff",padding:"4px 8px",fontSize:"12px",fontFamily:"monospace",border:"1px solid rgba(255,255,255,0.2)",zIndex:"1000",pointerEvents:"none"}),e.textContent="FPS: 0",document.body.appendChild(e),this.displayElement=e}};var At=class extends f{constructor(e){super(e);this.history=[];this.maxPoints=0;this.canvasHeight=0;this.currentValue=0;this.targetValue=0;this._type=2}onInit(){this.initCanvas(),this.maxPoints=this.canvas.width}onScroll(e){let r=Math.abs(e.scroll.displacement);this.currentValue=r,this.history.push(r),this.history.length>this.maxPoints&&this.history.shift(),this.draw()}draw(){let e=this.context,r=this.canvas.width,i=this.canvas.height;e.clearRect(0,0,r,i),e.strokeStyle="#007bff",e.lineWidth=2,e.beginPath(),this.history.forEach((o,s)=>{let n=s,a=i-o/2;s===0?e.moveTo(n,a):e.lineTo(n,a)}),e.stroke()}initCanvas(){this.canvas=document.createElement("canvas"),this.canvasHeight=window.innerHeight/15-20,this.canvas.width=window.innerWidth*.5,this.canvas.height=this.canvasHeight,Object.assign(this.canvas.style,{position:"fixed",bottom:"10px",left:"50%",transform:"translateX(-50%)",backgroundColor:"#000",border:"1px solid rgba(255,255,255,0.2)",zIndex:"1000",pointerEvents:"none"}),this.context=this.canvas.getContext("2d"),document.body.appendChild(this.canvas)}setTarget(e){this.targetValue=e}clear(){this.canvas.remove(),this.history=[]}};var Ht=class extends f{constructor(t){super(t),this._type=2}onInit(){this.createDisplayElement()}onScroll(t){let e=t.scroll.current,r=t.scroll.target,i=e<r?"\u2193":e>r?"\u2191":"-";this.displayElement.setAttribute("data-dir",i),this.displayElement.setAttribute("data-val",`${Math.round(e)}`)}destroy(){this.displayElement.remove()}createDisplayElement(){let t=document.createElement("div");Object.assign(t.style,{position:"fixed",bottom:"10px",left:"10px",backgroundColor:"#000",color:"#fff",border:"1px solid rgba(255,255,255,0.2)",padding:"5px 8px",fontSize:"12px",fontFamily:"monospace",zIndex:"1000",pointerEvents:"none"}),t.setAttribute("data-dir","-"),t.setAttribute("data-val","0"),document.body.appendChild(t);let e=document.createElement("style");e.innerHTML=`
|
|
19
|
+
`,document.head.appendChild(t)}createScrollbar(){this.scrollbar=document.createElement("div"),this.scrollbar.classList.add("scrollbar"),this.thumb=document.createElement("div"),this.thumb.classList.add("thumb"),this.scrollbar.appendChild(this.thumb),document.body.appendChild(this.scrollbar),this.scrollbarStateHorizontal=new $t(this.data,this.scrollbar,this.thumb),this.scrollbarStateVertical=new Yt(this.data,this.scrollbar,this.thumb),this.scrollbarState=this.scrollbarStateVertical}updateThumb(){this.scrollbarState.updateThumb()}mouseDownEvent(t){this.isDragging=!0,this.scrollbarState.mouseDownEvent(t),document.body.style.userSelect="none",this.scrollbar.classList.add("-touch")}mouseMoveEvent(t){this.isDragging&&this.scrollbarState.mouseMoveEvent(t)}mouseUpEvent(){this.isDragging=!1,document.body.style.userSelect="",this.hideScrollbar(),this.scrollbar.classList.remove("-touch")}showScrollbar(){this.scrollbar.classList.add("-scroll")}hideScrollbar(){this.scrollTimeout&&clearTimeout(this.scrollTimeout),this.scrollTimeout=setTimeout(()=>{this.scrollbar.classList.remove("-scroll")},1e3)}};var W={BEFORE_ELEMENT:"-before-element",AFTER_ELEMENT:"-after-element"};function _e(c){if(!c||!Array.isArray(c.chars)||c.chars.length===0)return[];let e=c.chars[0].splitClass??[];if(e.length===0)return[];for(let t of c.chars){let r=t.splitClass??[];if(r.length!==e.length)return[];for(let i=0;i<r.length;i++)if(r[i]!==e[i])return[]}return e}function Se(c,e,t){let r=document.createDocumentFragment(),i=0,n=A(e,"line")||A(e,"charLine")||A(e,"wordLine"),o=0;c.forEach(l=>o+=l.words.length),o--;let s=0;c.forEach(l=>l.words.forEach(d=>s+=d.chars.length));let a=new Map;return c.forEach((l,d)=>{let p=d===c.length-1,u=r,b=[];if(n&&(u=document.createElement("span"),u.setAttribute("aria-hidden","true"),u.classList.add("-s-line"),l.isBeforeElement&&u.classList.add(W.BEFORE_ELEMENT),l.isAfterElement&&u.classList.add(W.AFTER_ELEMENT),u.style.setProperty("--line-index",String(l.lineIndex)),u.style.setProperty("--word-total",String(l.words.length)),he(u,l.calculatedValues,e)),l.words.forEach((m,h)=>{n&&(o=l.words.length-1);let v=h===o;if(m.chars.length===1&&m.chars[0].token.type==="element"){let f=m.chars[0].token.node.cloneNode(!0);u.appendChild(f),v||u.appendChild(document.createTextNode("\xA0"));return}let g=m.chars.map(f=>f.char).join("");g&&b.push(g);let E=A(e,"word")||A(e,"charWord")||A(e,"wordLine"),x=E?document.createElement("span"):u,S=_e(m);if(E&&(x.setAttribute("aria-hidden","true"),x.classList.add("-s-word"),m.isBeforeElement&&x.classList.add(W.BEFORE_ELEMENT),m.isAfterElement&&x.classList.add(W.AFTER_ELEMENT),x.style.setProperty("--word-index",String(m.wordIndexGlobal)),x.style.setProperty("--char-total",String(m.chars.length)),x.setAttribute("data-split-content",g),he(x,m.calculatedValues,e),S.length&&x.classList.add(...S)),A(e,"char")||A(e,"charLine")||A(e,"charWord"))m.chars.forEach((f,w)=>{if(f.char===" "||f.char===" ")return;let T=document.createElement("span");T.setAttribute("aria-hidden","true");let P=T;P.classList.add("-s-char"),f.isBeforeElement&&P.classList.add(W.BEFORE_ELEMENT),f.isAfterElement&&P.classList.add(W.AFTER_ELEMENT),P.textContent=f.char,P.setAttribute("data-split-content",f.char),P.style.setProperty("--char-index",String(i++));let O=m.chars[w+1];if(O){let k=t.getKerning(f.char,O.char);Math.abs(k)>.01&&(P.style.marginRight=`${k.toFixed(2)}px`)}he(P,f.calculatedValues,e);let D=f.splitClass??[];D.length&&!S.length&&P.classList.add(...D),x.appendChild(T)}),a.set("--char-global-total",String(s));else{let f=document.createTextNode(g);x.appendChild(f)}E&&u.appendChild(x),n?v?p||u.appendChild(document.createElement("br")):x.appendChild(document.createTextNode("\xA0")):v||x.appendChild(document.createTextNode("\xA0"))}),n){let m=b.join(" ");u.setAttribute("data-split-content",m),r.appendChild(u)}}),{fragment:r,extraProps:a}}function he(c,e,t){if(e)for(let r of e){if(!qe(r.type,r.align,t))continue;let i=Xe(r.type,r.align);c.style.setProperty(i,String(r.value))}}function qe(c,e,t){let r=t[c]??[];return Array.isArray(r)&&r.some(i=>e.startsWith("random")?i.align.startsWith("random"):i.align===e)}function Xe(c,e){let t=e.startsWith("random")?"random":e;return`--${c}-${t}`}function A(c,e){return Array.isArray(c[e])&&c[e].length>0}var lt=0;function Me(c){lt=0;let e=[],t=(i,n)=>{n&&Object.keys(n).length&&(i.meta={...i.meta||{},...n}),e.push(i)},r=(i,n)=>{if(i.nodeType===Node.ELEMENT_NODE){let o=i,s=o.tagName.toLowerCase();if(s==="split-class"){let a=(o.getAttribute("class")??"").split(/\s+/).filter(Boolean),l={...n||{},splitClass:[...n?.splitClass??[],...a]};o.childNodes.forEach(d=>r(d,l));return}if(s==="br"){t({type:"br",id:`br_${lt++}`,node:o,tagName:"br"},n);return}t({type:"element",id:`el_${lt++}`,node:o,tagName:s},n);return}if(i.nodeType===Node.TEXT_NODE){let o=i.nodeValue??"",s=`text_${lt++}`;o.trim()?t({type:"text",id:s,node:i,content:o},n):t({type:"space",id:s,node:i,content:o},n);return}t({type:"other",id:`node_${lt++}`,node:i},n)};return c.forEach(i=>r(i)),e}var qt=class{constructor(e){this.font="";this.cache={kerning:new Map,charWidth:new Map};let t=document.createElement("canvas");this.ctx=t.getContext("2d"),this.setFontFromElement(e)}setFontFromElement(e){let t=window.getComputedStyle(e),r=`${t.fontStyle} ${t.fontVariant} ${t.fontWeight} ${t.fontSize}/${t.lineHeight} ${t.fontFamily}`;r!==this.font&&(this.font=r,this.ctx.font=this.font,this.cache.kerning.clear(),this.cache.charWidth.clear())}getCharWidth(e){if(this.cache.charWidth.has(e))return this.cache.charWidth.get(e);let t=this.ctx.measureText(e).width;return this.cache.charWidth.set(e,t),t}getKerning(e,t){let r=`${e}${t}`,i=`${this.font}|${r}`;if(this.cache.kerning.has(i))return this.cache.kerning.get(i);let n=this.ctx.measureText(r).width,o=this.getCharWidth(e)+this.getCharWidth(t),s=n-o;return this.cache.kerning.set(i,s),s}measureWord(e){let t=0;for(let r=0;r<e.length;r++){let i=e[r];if(t+=this.getCharWidth(i),r>0){let n=e[r-1];t+=this.getKerning(n,i)}}return t}};function je(c){let e=[],t=[];for(let r of c)r.type==="br"?(t.length&&e.push(t),e.push([r]),t=[]):t.push(r);return t.length&&e.push(t),e}function xe(c,e,t){let r=document.createElement("div"),i=window.getComputedStyle(e);r.style.position="absolute",r.style.visibility="hidden",r.style.pointerEvents="none",r.style.width=e.clientWidth+"px",r.style.padding=i.padding,r.style.font=i.font,r.style.letterSpacing=i.letterSpacing,r.style.lineHeight=i.lineHeight,r.style.fontVariant=i.fontVariant,r.style.fontStretch=i.fontStretch,r.style.wordBreak=i.wordBreak,r.style.wordWrap=i.wordWrap,r.style.whiteSpace=i.whiteSpace;let n=document.createElement("span");n.textContent="\xA0",r.appendChild(n);let o=n.getBoundingClientRect().width;r.removeChild(n),r.style.width=e.clientWidth+o+"px",r.style.boxSizing="border-box",e.appendChild(r);let s=[],a=je(c),l=!1,d=!1,p=!1;for(let u of a){if(u.length===1&&u[0].type==="br"){s.push({token:u[0],rect:new DOMRect(0,0,0,0)});continue}if(u.length===0)continue;r.innerHTML="";let b=[],m=[];u.forEach(h=>{switch(h.type){case"text":{let v=h.content,y=/^\s/.test(v),g=/\s$/.test(v),E=v.trim().split(/\s+/).filter(x=>x.length>0);E.forEach((x,S)=>{let C=document.createElement("span");C.style.display="inline-block",C.textContent=x,r.appendChild(C),(S<E.length-1||g)&&r.appendChild(document.createTextNode(" ")),b.push(C),m.push({token:{type:"text",id:"",node:h.node,content:x,meta:{...h.meta||{},joinPrev:S===0?!y&&!d&&p:!1}},wordIndex:b.length-1,hadLeadingSpace:y,hadTrailingSpace:g})}),d=g,p=!0;break}case"element":{let v=h.node.cloneNode(!0),y=document.createElement("span");y.style.display="inline-block",y.appendChild(v),r.appendChild(y),b.push(y),m.push({token:h}),l=!0,p=!1,d=!1;break}case"space":d=!0;break;case"other":p=!1,d=!1;break}}),r.offsetHeight,m.forEach((h,v)=>{if(h.wordIndex!==void 0){let g=b[h.wordIndex].getBoundingClientRect(),E;if(h.token.type==="text"){let S=t.measureWord(h.token.content);E=new DOMRect(g.x,g.y,S,g.height)}else E=g;let x={token:h.token,rect:E};if(l&&h.token.type==="text"&&(l=!1,x.token.meta={...x.token.meta||{},isAfterElement:!0}),s.push(x),h.token.type==="element"){let S=s[s.length-2];S?.token.type==="text"&&(S.token.meta={...S.token.meta||{},isBeforeElement:!0})}}})}return e.removeChild(r),s}var Ee=5;function Ce(c,e,t){let r=[],i=null,n=0,o=0,s=0;return c.forEach(a=>{let l=a.token,d=l.meta?.isBeforeElement??!1,p=l.meta?.isAfterElement??!1;if(l.type==="br"){i=null;return}if(l.type==="text"){let u=l.content,b=l.meta?.splitClass??[],m=!!l.meta?.joinPrev,h=[],v=0;for(let f=0;f<u.length;f++){let w=u[f],T=f>0?u[f-1]:null,P=t.getCharWidth(w),O=T?t.getKerning(T,w):0;v+=O;let D=new DOMRect(a.rect.left+v,a.rect.top,P,a.rect.height),k={char:w,rect:D,token:l,charIndexInWord:f,charIndexInLine:0,charIndexGlobal:o++};b.length&&(k.splitClass=b),h.push(k),v+=P}if(h.length>0){let f=h[h.length-1];d&&(f.isBeforeElement=!0),p&&(f.isAfterElement=!0)}let y=Math.round(a.rect.top),g=Math.round(n);if((!i||Math.abs(y-g)>Ee)&&(n=y,i={words:[],rect:a.rect,lineIndex:r.length},r.push(i)),!i)return;if(m&&i.words.length>0){let f=i.words[i.words.length-1],w=i.words.reduce((P,O)=>P+O.chars.length,0),T=f.chars.length;h.forEach((P,O)=>{P.charIndexInLine=w+O,P.charIndexInWord=T+O}),f.chars.push(...h),f.rect=Xt([f.rect,a.rect]),i.rect=Xt(i.words.map(P=>P.rect)),d&&(f.isBeforeElement=!0),p&&(f.isAfterElement=!0);return}let x=i.words.length,S=i.words.reduce((f,w)=>f+w.chars.length,0);h.forEach((f,w)=>f.charIndexInLine=S+w);let C={chars:h,rect:a.rect,wordIndexGlobal:s++,wordIndexInLine:x,isBeforeElement:d,isAfterElement:p};i.words.push(C),i.rect=Xt(i.words.map(f=>f.rect)),d&&(i.isBeforeElement=!0),p&&(i.isAfterElement=!0);return}if(l.type==="element"){let u=a.rect,b=Math.round(u.top),m=Math.round(n);if((!i||Math.abs(b-m)>Ee)&&(n=b,i={words:[],rect:u,lineIndex:r.length},r.push(i)),!i)return;let v=i.words.length,y=i.words.reduce((x,S)=>x+S.chars.length,0),E={chars:[{char:"[E]",rect:u,token:l,charIndexInWord:0,charIndexInLine:y,charIndexGlobal:o++}],rect:u,wordIndexGlobal:s++,wordIndexInLine:v,isBeforeElement:!1,isAfterElement:!1};i.words.push(E),i.rect=Xt(i.words.map(x=>x.rect))}}),r}function Xt(c){if(c.length===0)return new DOMRect(0,0,0,0);let e=Math.min(...c.map(n=>n.left)),t=Math.min(...c.map(n=>n.top)),r=Math.max(...c.map(n=>n.right)),i=Math.max(...c.map(n=>n.bottom));return new DOMRect(e,t,r-e,i-t)}var jt=class extends M{constructor(e){super(e),this.htmlKey="split",this.permissions.mobile.rebuild.height=!1,this.permissions.mobile.rebuild.width=!1}onResizeWidth(){this.objectsOnPage.forEach(e=>{this.onObjectConnected(e)})}onObjectConnected(e){let t=e.htmlElement;if(!t)return;let r=t.classList.contains("-splitted"),i=t.getAttribute("string-split-original");(!r||i===null)&&(i=this.escapeAttribute(t.innerHTML),t.setAttribute("string-split-original",i),t.classList.add("-splitted")),e.htmlElement.innerHTML=i;let n=t.getAttribute("string-split")??t.getAttribute("data-string-split")??"",o=this.tools.optionsParser.process({attributeValue:n}),{fragment:s,result:a,extraProps:l}=this.split(t,o);e.setProperty("nodes",s.childNodes),t.setAttribute("aria-label",i),t.innerHTML="",t.appendChild(a),l.forEach((p,u)=>{t.style.setProperty(u,p)});let d=t.getAttribute("string-split-restore-after");d&&!isNaN(Number(d))&&setTimeout(()=>{t.innerHTML=i,t.classList.add("-restored")},Number(d))}split(e,t){let r=new qt(e),i=document.createDocumentFragment();e.childNodes.forEach(l=>i.appendChild(l.cloneNode(!0)));let n=Me(i.childNodes),o=xe(n,e,r),s=Ce(o,e,r);this.applyCalculatedValues(s,t);let a=Se(s,t,r);return{fragment:i,result:a.fragment,extraProps:a.extraProps}}computeValue(e,t,r){if(e.align.startsWith("random")){let i=e.random?.min??0,n=e.random?.max??r-1;return Math.floor(Math.random()*(n-i+1))+i}switch(e.align){case"start":return t;case"end":return r-t-1;case"center":{let i=Math.floor((r-1)/2);return Math.abs(t-i)}default:return t}}applyCalculatedValues(e,t){let r=o=>o.words.reduce((s,a)=>s+a.chars.length,0),i=e.reduce((o,s)=>o+s.words.length,0),n=e.reduce((o,s)=>o+s.words.reduce((a,l)=>a+l.chars.length,0),0);e.forEach((o,s)=>{t.line&&(o.calculatedValues=t.line.map(a=>({type:"line",align:a.align,value:this.computeValue(a,s,e.length)}))),o.words.forEach((a,l)=>{t.word&&(a.calculatedValues=t.word.map(p=>({type:"word",align:p.align,value:this.computeValue(p,a.wordIndexGlobal,i)}))),t.wordLine&&(a.calculatedValues??(a.calculatedValues=[]),a.calculatedValues.push(...t.wordLine.map(p=>({type:"wordLine",align:p.align,value:this.computeValue(p,a.wordIndexInLine,o.words.length)}))));let d=r(o);a.chars.forEach(p=>{let u=[];t.char&&u.push(...t.char.map(b=>({type:"char",align:b.align,value:this.computeValue(b,p.charIndexGlobal,n)}))),t.charWord&&u.push(...t.charWord.map(b=>({type:"charWord",align:b.align,value:this.computeValue(b,p.charIndexInWord,a.chars.length)}))),t.charLine&&u.push(...t.charLine.map(b=>({type:"charLine",align:b.align,value:this.computeValue(b,p.charIndexInLine,d)}))),p.calculatedValues=u})})})}escapeAttribute(e){return e.replace(/src="(https?:\/\/[^"\s]+)"/g,"src=$1")}};var Ut=class extends M{constructor(t){super(t);this.history=[];this.maxPoints=0;this.height=0;this.value=0;this.target=0;this._type=2}onInit(){this.initCanvas(),this.maxPoints=this.canvas.width}onScroll(t){let r=Math.abs(t.scroll.displacement);this.value=r,this.history.push(r),this.history.length>this.maxPoints&&this.history.shift(),this.draw()}draw(){let t=this.context,r=this.canvas.width,i=this.canvas.height;t.clearRect(0,0,r,i),t.strokeStyle="red",t.lineWidth=2,t.beginPath(),this.history.forEach((n,o)=>{let s=o,a=i-n*this.height;o===0?t.moveTo(s,a):t.lineTo(s,a)}),t.stroke()}initCanvas(){let t=document.createElement("canvas"),r=window.innerWidth*.5;this.height=window.innerHeight/15-20,t.width=r,t.height=this.height,Object.assign(t.style,{position:"fixed",bottom:`${window.innerHeight/20+10}px`,left:"50%",transform:"translateX(-50%)",backgroundColor:"#000000",border:"1px solid rgba(255, 255, 255, 0.2)",zIndex:"1000",pointerEvents:"none"}),this.canvas=t,this.context=t.getContext("2d"),document.body.appendChild(t)}setTarget(t){this.target=t}clear(){this.canvas.remove(),this.history=[]}};var Kt=class extends M{constructor(t){super(t);this.frameCount=0;this._type=2}onInit(){this.data.system.fpsTracker&&this.createDisplayElement(),this.intervalId=window.setInterval(()=>{this.data.system.fpsTracker&&(this.displayElement.textContent=`FPS: ${this.frameCount}`),this.events.emit("fps",this.frameCount),this.frameCount=0},1e3)}onFrame(t){this.frameCount++}destroy(){clearInterval(this.intervalId),this.displayElement.remove()}createDisplayElement(){let t=document.createElement("div");Object.assign(t.style,{position:"fixed",bottom:"10px",right:"10px",backgroundColor:"#000",color:"#fff",padding:"4px 8px",fontSize:"12px",fontFamily:"monospace",border:"1px solid rgba(255,255,255,0.2)",zIndex:"1000",pointerEvents:"none"}),t.textContent="FPS: 0",document.body.appendChild(t),this.displayElement=t}};var Qt=class extends M{constructor(t){super(t);this.history=[];this.maxPoints=0;this.canvasHeight=0;this.currentValue=0;this.targetValue=0;this._type=2}onInit(){this.initCanvas(),this.maxPoints=this.canvas.width}onScroll(t){let r=Math.abs(t.scroll.displacement);this.currentValue=r,this.history.push(r),this.history.length>this.maxPoints&&this.history.shift(),this.draw()}draw(){let t=this.context,r=this.canvas.width,i=this.canvas.height;t.clearRect(0,0,r,i),t.strokeStyle="#007bff",t.lineWidth=2,t.beginPath(),this.history.forEach((n,o)=>{let s=o,a=i-n/2;o===0?t.moveTo(s,a):t.lineTo(s,a)}),t.stroke()}initCanvas(){this.canvas=document.createElement("canvas"),this.canvasHeight=window.innerHeight/15-20,this.canvas.width=window.innerWidth*.5,this.canvas.height=this.canvasHeight,Object.assign(this.canvas.style,{position:"fixed",bottom:"10px",left:"50%",transform:"translateX(-50%)",backgroundColor:"#000",border:"1px solid rgba(255,255,255,0.2)",zIndex:"1000",pointerEvents:"none"}),this.context=this.canvas.getContext("2d"),document.body.appendChild(this.canvas)}setTarget(t){this.targetValue=t}clear(){this.canvas.remove(),this.history=[]}};var Gt=class extends M{constructor(e){super(e),this._type=2}onInit(){this.data.system.positionTracker&&this.createDisplayElement()}onScroll(e){let t=e.scroll.current,r=e.scroll.target;if(this.data.system.positionTracker){let i=t<r?"\u2193":t>r?"\u2191":"-";this.displayElement.setAttribute("data-dir",i),this.displayElement.setAttribute("data-val",`${Math.round(t)}`)}this.events.emit("scroll-position",Math.round(t))}destroy(){this.displayElement.remove()}createDisplayElement(){let e=document.createElement("div");Object.assign(e.style,{position:"fixed",bottom:"10px",left:"10px",backgroundColor:"#000",color:"#fff",border:"1px solid rgba(255,255,255,0.2)",padding:"5px 8px",fontSize:"12px",fontFamily:"monospace",zIndex:"1000",pointerEvents:"none"}),e.setAttribute("data-dir","-"),e.setAttribute("data-val","0"),document.body.appendChild(e);let t=document.createElement("style");t.innerHTML=`
|
|
20
20
|
div[data-dir][data-val]::before {
|
|
21
21
|
content: attr(data-dir) ' Top: ' attr(data-val) 'px';
|
|
22
22
|
}
|
|
23
|
-
`,document.head.appendChild(e),this.displayElement=t}};function le(c,t){let e=null;return function(...r){let i=this;e&&clearTimeout(e),e=setTimeout(()=>{c.apply(i,r),e=null},t)}}var Ft=class{constructor(){this.fps=0;this.isAnimationStarted=!1;this.fpsInterval=0;this.then=0;this.requestAnimationId=0;this.onFrameCallback=t=>{};this.animate=()=>{};this.onVisibilityChangeBind=this.onVisibilityChange.bind(this)}onVisibilityChange(){document.hidden?(this.stop(),this.isAnimationStarted=!1):this.start(this.fps)}start(t){this.fps=t,!this.isAnimationStarted&&(this.fpsInterval=1e3/t,this.then=performance.now(),this.isAnimationStarted=!0,t===0?this.animate=()=>{let e=performance.now();this.requestAnimationId=requestAnimationFrame(()=>this.animate()),this.onFrameCallback(e)}:this.animate=()=>{let e=performance.now(),r=e-this.then;r>this.fpsInterval&&(this.then=e-r%this.fpsInterval,this.onFrameCallback(e)),this.requestAnimationId=requestAnimationFrame(()=>this.animate())},this.animate())}stop(){this.isAnimationStarted&&(cancelAnimationFrame(this.requestAnimationId),this.requestAnimationId=0,this.isAnimationStarted=!1)}setOnFrame(t){this.onFrameCallback=t}destructor(){this.stop()}};var Bt=class extends f{constructor(t){super(t),this.htmlKey="autoplay",this.attributesToMap=[...this.attributesToMap,{key:"src",type:"string",fallback:""}]}onObjectConnected(t){t.setProperty("onEnterEvent",this.onEnterObject.bind(this)),t.events.on("enter",t.getProperty("onEnterEvent")),t.setProperty("onLeaveEvent",this.onLeaveObject.bind(this)),t.events.on("leave",t.getProperty("onLeaveEvent"));let e=t.htmlElement,r=this.tools.domAttribute.process({element:e,key:"string-started",fallback:null})!==null;e.tagName.toLowerCase()==="video"&&!r&&(e.setAttribute("string-started",""),e.muted=!0,e.setAttribute("muted","muted"),e.setAttribute("playsinline",""),e.setAttribute("loop",""),e.setAttribute("autoplay",""),e.src=t.getProperty("src"),e.load(),e.addEventListener("canplay",()=>{}))}onEnterObject(t){let e=t.htmlElement;this.tryPlay(e)}onLeaveObject(t){t.htmlElement.pause()}tryPlay(t){t.play().catch(e=>console.warn("[StringVideoAutoplay] Autoplay failed:",e))}};var Jt=(r=>(r.ACTIVE="-active",r.HIDE="-hide",r.DISABLE="-disable",r))(Jt||{});var Wt=class extends f{constructor(e){super(e);this.activeStepForSlides=new Map;this.hideStepForSlides=new Map;this.htmlKey="sequence",this.attributesToMap=[...this.attributesToMap,{key:"sequence",type:"string",fallback:"string[0]"}]}onInit(){super.onInit(),this.events.on("sequence",({slider:e,step:r})=>{this.objectsOnPage.forEach(o=>{let s=o.getProperty("sequence");s==`${e}[${this.hideStepForSlides.get(e)}]`&&s!=`${e}[${r}]`&&this.setSequenceState(o,"-disable"),s==`${e}[${this.activeStepForSlides.get(e)}]`&&this.setSequenceState(o,"-hide"),s==`${e}[${r}]`&&this.setSequenceState(o,"-active")});let i=this.activeStepForSlides.get(e);i!=null&&this.hideStepForSlides.set(e,i),this.activeStepForSlides.set(e,r)})}onObjectConnected(e){super.onObjectConnected(e),this.setSequenceState(e,"-disable")}setSequenceState(e,r){requestAnimationFrame(()=>{e.htmlElement.classList.remove(...Object.values(Jt)),e.htmlElement.classList.add(r)})}};var Nt=class extends f{constructor(t){super(t),this.htmlKey="form"}initializeObject(t,e,r,i){super.initializeObject(t,e,r,i),e.getProperty("form-events")?.forEach(p=>{p.eventElement.addEventListener("beforeinput",p.eventCallback),p.eventElement.removeEventListener(p.eventType,p.eventCallback)}),e.setProperty("form-events",[]),super.onObjectConnected(e);let o=e.htmlElement,s=["error","group"],n=p=>s.some(d=>p.startsWith(d+"[")),a=Array.from(o.querySelectorAll("[string-input]")).filter(p=>!n(p.getAttribute("string-input")||"")),l={};for(let p=0;p<a.length;p++){let d=a[p],g=this.getInputKey(d,p),m=this.tools.domAttribute.process({element:d,key:"input"})??"";l[g]=this.tools.ruleParser.process({value:m});let h=d instanceof HTMLSelectElement||d instanceof HTMLInputElement&&(d.type==="checkbox"||d.type==="radio")?"change":"input",b=()=>{if(!d.classList.contains("-error"))return;let y=this.getInputKey(d,p),v=l[y],x=this.getFieldValue(d),{valid:S,errors:E}=this.tools.validation.process({rules:v,value:x}),C=o.querySelector(`[string-input="error[${y}]"]`),T=o.querySelector(`[string-input="group[${y}]"]`);if(C){C.innerHTML="";for(let w of E){let O=document.createElement("span");O.textContent=w,C.appendChild(O)}}d.classList.toggle("-error",!S),d.classList.toggle("-valid",S),T&&(T.classList.toggle("-error",!S),T.classList.toggle("-valid",S))},M=y=>{let v=this.getInputKey(d,p),x=l[v],S=d.value,E=d.selectionStart??0,C=d.selectionEnd??0,T=S;switch(y.inputType){case"deleteContentBackward":T=E===C&&E>0?S.slice(0,E-1)+S.slice(C):S.slice(0,E)+S.slice(C);break;case"deleteContentForward":T=E===C&&E<S.length?S.slice(0,E)+S.slice(E+1):S.slice(0,E)+S.slice(C);break;case"insertFromPaste":case"insertFromDrop":case"insertReplacementText":T=S.slice(0,E)+(y.data||"")+S.slice(C);break;default:typeof y.data=="string"&&(T=S.slice(0,E)+y.data+S.slice(C))}let{errors:w}=this.tools.validation.process({rules:x,value:T,type:"beforeinput"});w.length>0&&y.preventDefault()};e.getProperty("form-events").push({eventElement:d,eventType:h,eventCallback:b}),e.getProperty("form-events").push({eventElement:d,eventType:"beforeinput",eventCallback:M}),d.addEventListener("beforeinput",M),d.addEventListener(h,b),d.classList.add("-inited")}let u=p=>{p.preventDefault();let d=!0,g={};for(let m=0;m<a.length;m++){let h=a[m];if(h.disabled||h instanceof HTMLInputElement&&h.type==="hidden")continue;let b=this.getInputKey(h,m),M=l[b],y=this.getFieldValue(h);g[b]=y;let{valid:v,errors:x}=this.tools.validation.process({rules:M,value:y}),S=o.querySelector(`[string-input="error[${b}]"]`),E=o.querySelector(`[string-input="group[${b}]"]`);if(S){S.innerHTML="";for(let C of x){let T=document.createElement("span");T.textContent=C,S.appendChild(T)}}h.classList.toggle("-error",!v),h.classList.toggle("-valid",v),E&&(E.classList.toggle("-error",!v),E.classList.toggle("-valid",v)),v||(d=!1)}if(d)this.events.emit(`form:submit:${e.id}`,g);else{let m=a.find((h,b)=>{let M=this.getInputKey(h,b),y=l[M],v=this.getFieldValue(h),{valid:x}=this.tools.validation.process({rules:y,value:v});return!x});m&&typeof m.focus=="function"&&m.focus(),this.events.emit(`form:invalid:${e.id}`)}};e.getProperty("form-events").push({eventElement:o,eventType:"submit",eventCallback:u}),o.addEventListener("submit",u)}onObjectConnected(t){}getInputKey(t,e){return this.tools.domAttribute.process({element:t,key:"id"})||t.getAttribute("name")||t.getAttribute("id")||`input-${e}`}getFieldValue(t){if(t instanceof HTMLInputElement){if(t.type==="checkbox"){if(t.name){let e=t.form||t.closest("form"),r=e?Array.from(e.querySelectorAll(`input[type="checkbox"][name="${t.name}"]:checked`)):[t];return r.length>1?r.map(i=>i.value):r.length===1?r[0].value:""}return t.checked}if(t.type==="radio"){if(t.name){let r=(t.form||t.closest("form"))?.querySelector(`input[type="radio"][name="${t.name}"]:checked`);return r?r.value:""}return t.checked?t.value:""}return t.value}return t instanceof HTMLSelectElement?t.multiple?Array.from(t.selectedOptions).map(e=>e.value):t.value:t instanceof HTMLTextAreaElement?t.value:""}};var Vt=class{constructor(){this.map=new WeakMap;this.all=new Set}attach(t){if(this.map.has(t))return;let e=t.htmlElement,r={cx:0,cy:0,valid:!1,el:e};r.ro=new ResizeObserver(()=>{r.valid=!1}),r.ro.observe(e),this.map.set(t,r),this.all.add(t)}detach(t){let e=this.map.get(t);e&&(e.ro?.disconnect(),this.map.delete(t),this.all.delete(t))}invalidateAll(){this.all.forEach(t=>{let e=this.map.get(t);e&&(e.valid=!1)})}getCenter(t){let e=this.map.get(t);if(!e||!e.el)return{cx:0,cy:0};if(!e.valid){let r=e.el.getBoundingClientRect();e.cx=r.left+r.width/2,e.cy=r.top+r.height/2,e.valid=!0}return{cx:e.cx,cy:e.cy}}};var $t=class{constructor(){this.active=new Set;this.subs=new WeakMap}track(t){if(this.subs.has(t))return;let e=t.htmlElement,r=()=>this.active.add(t),i=()=>this.active.delete(t);e.addEventListener("pointerenter",r),e.addEventListener("pointerleave",i),this.subs.set(t,{enter:r,leave:i})}untrack(t){let e=this.subs.get(t);if(!e)return;let r=t.htmlElement;e.enter&&r.removeEventListener("pointerenter",e.enter),e.leave&&r.removeEventListener("pointerleave",e.leave),this.active.delete(t),this.subs.delete(t)}isActive(t){return this.active.has(t)}activeObjects(){return Array.from(this.active)}};var zt=class extends f{constructor(e){super(e);this.nearOnly=!0;this.emitEveryN=2;this.updateThreshold=.1;this.rafFrame=0}onObjectConnected(e){super.onObjectConnected(e),this.centers.attach(e),this.hover.track(e)}removeObject(e){let r=this.objectMapOnPage.get(e);r&&(this.centers.detach(r),this.hover.untrack(r)),super.removeObject(e)}onScroll(){this.centers.invalidateAll()}onMouseMove(e){let r=e.clientX,i=e.clientY,o=this.nearOnly&&this.hover.activeObjects().length?this.hover.activeObjects():this.objects;for(let s=0;s<o.length;s++){let n=o[s],{cx:a,cy:l}=this.centers.getCenter(n),u=r-a,p=i-l,d=u*u+p*p;this.nearOnly&&d>this.data.viewport.windowWidth*this.data.viewport.windowWidth&&!this.hover.isActive(n)||this.onPointerDelta(n,u,p,Math.sqrt(d))}}onFrame(e){this.rafFrame++,this.onCursorFrame(e,this.rafFrame)}};var _t=class extends f{constructor(t){super(t),this.htmlKey="scroller"}onObjectConnected(t){let e=t.getProperty("scroller-inited");if(e==null||e==""){t.setProperty("scroller-inited","inited");let r=i=>{this.events.emit("wheel",i)};t.setProperty("scroller-wheel-event",r),t.htmlElement.addEventListener("wheel",r)}}onObjectDisconnected(t){t.setProperty("scroller-inited",""),t.htmlElement.removeEventListener("wheel",t.getProperty("scroller-wheel-event"))}};var qt=class extends f{constructor(t){super(t),this.htmlKey="impulse",this.attributesToMap.push({key:"position-strength",type:"number",fallback:this.settings["position-strength"]},{key:"position-tension",type:"number",fallback:this.settings["position-tension"]},{key:"position-friction",type:"number",fallback:this.settings["position-friction"]},{key:"position-max-velocity",type:"number",fallback:this.settings["position-max-velocity"]},{key:"position-update-threshold",type:"number",fallback:this.settings["position-update-threshold"]},{key:"rotation-strength",type:"number",fallback:this.settings["rotation-strength"]},{key:"rotation-tension",type:"number",fallback:this.settings["rotation-tension"]},{key:"rotation-friction",type:"number",fallback:this.settings["rotation-friction"]},{key:"rotation-max-angular-velocity",type:"number",fallback:this.settings["rotation-max-angular-velocity"]},{key:"rotation-max-angle",type:"number",fallback:this.settings["rotation-max-angle"]},{key:"rotation-update-threshold",type:"number",fallback:this.settings["rotation-update-threshold"]},{key:"max-offset",type:"number",fallback:this.settings["max-offset"]},{key:"sleep-epsilon",type:"number",fallback:this.settings["sleep-epsilon"]},{key:"continuous-push",type:"boolean",fallback:this.settings["continuous-push"]})}onObjectConnected(t){super.onObjectConnected(t),t.setProperty("offset-x",0),t.setProperty("offset-y",0),t.setProperty("velocity-x",0),t.setProperty("velocity-y",0),t.setProperty("angle-deg",0),t.setProperty("ang-vel-deg",0),t.setProperty("__prev-css-x",0),t.setProperty("__prev-css-y",0),t.setProperty("__prev-css-rot",0),t.setProperty("__push-latch",!1),this.hover.track(t),this.centers.attach(t)}onObjectDisconnected(t){this.hover.untrack(t),this.centers.detach(t)}onMouseMove(t){let e=this.hover.activeObjects();if(e.length===0)return;let r=this.data.cursor.velocityX,i=this.data.cursor.velocityY;if(r===0&&i===0)return;let o=this.data.cursor.targetX,s=this.data.cursor.targetY;for(let n=0;n<e.length;n++){let a=e[n],l=a.getProperty("position-strength")||0;if(l!==0){let p=a.getProperty("continuous-push")??!0,d=a.getProperty("__push-latch")===!0;if(p||!d){let g=a.getProperty("velocity-x")||0,m=a.getProperty("velocity-y")||0;g+=r*l,m+=i*l,a.setProperty("velocity-x",g),a.setProperty("velocity-y",m),p||a.setProperty("__push-latch",!0)}}let u=a.getProperty("rotation-strength")??.75;if(u!==0){let{cx:p,cy:d}=this.centers.getCenter(a),g=o-p,m=s-d,h=g*i-m*r,b=a.getProperty("ang-vel-deg")||0;b+=h*u*.02,a.setProperty("ang-vel-deg",b)}}}onFrame(t){let e=new Set(this.hover.activeObjects());for(let r=0;r<this.objects.length;r++){let i=this.objects[r];!e.has(i)&&i.getProperty("__push-latch")===!0&&i.setProperty("__push-latch",!1)}for(let r=0;r<this.objects.length;r++){let i=this.objects[r],o=i.getProperty("offset-x")||0,s=i.getProperty("offset-y")||0,n=i.getProperty("velocity-x")||0,a=i.getProperty("velocity-y")||0,l=i.getProperty("position-tension")??.05,u=i.getProperty("position-friction")??.15,p=i.getProperty("position-max-velocity")??120,d=i.getProperty("max-offset")??220;n-=l*o,a-=l*s;let g=1-u;n*=g,a*=g,n>p?n=p:n<-p&&(n=-p),a>p?a=p:a<-p&&(a=-p),o+=n,s+=a,o>d?o=d:o<-d&&(o=-d),s>d?s=d:s<-d&&(s=-d);let m=i.getProperty("angle-deg")||0,h=i.getProperty("ang-vel-deg")||0,b=i.getProperty("rotation-tension")??.06,M=i.getProperty("rotation-friction")??.18,y=i.getProperty("rotation-max-angular-velocity")??6,v=i.getProperty("rotation-max-angle")??18;h-=b*m,h*=1-M,h>y?h=y:h<-y&&(h=-y),m+=h,m>v?(m=v,h*=.35):m<-v&&(m=-v,h*=.35);let x=i.getProperty("sleep-epsilon")??.01,S=n*n+a*a<x*x&&o*o+s*s<x*x,E=Math.abs(h)<x&&Math.abs(m)<x;S?(n||a||o||s)&&(i.setProperty("offset-x",0),i.setProperty("offset-y",0),i.setProperty("velocity-x",0),i.setProperty("velocity-y",0),o=s=n=a=0):(i.setProperty("offset-x",o),i.setProperty("offset-y",s),i.setProperty("velocity-x",n),i.setProperty("velocity-y",a)),E?(m||h)&&(i.setProperty("angle-deg",0),i.setProperty("ang-vel-deg",0),m=h=0):(i.setProperty("angle-deg",m),i.setProperty("ang-vel-deg",h));let C=i.getProperty("position-update-threshold")??.1,T=i.getProperty("rotation-update-threshold")??.15,w=i.getProperty("__prev-css-x")||0,O=i.getProperty("__prev-css-y")||0,W=i.getProperty("__prev-css-rot")||0,k=Math.round(o*10)/10,Xt=Math.round(s*10)/10,jt=Math.round(m*10)/10,Ut=Math.abs(k-w)>C||Math.abs(Xt-O)>C,Kt=Math.abs(jt-W)>T;(Ut||Kt)&&(this.applyToElementAndConnects(i,Qt=>{Ut&&(Qt.style.setProperty("--push-x",String(k)),Qt.style.setProperty("--push-y",String(Xt))),Kt&&Qt.style.setProperty("--push-rotation",String(jt))}),Ut&&(i.setProperty("__prev-css-x",k),i.setProperty("__prev-css-y",Xt)),Kt&&i.setProperty("__prev-css-rot",jt))}}};function ce(c){let t=c.match(/([^[]+)\[([\d.]+)-([\d.]+)\]/);return t?{id:t[1],start:parseFloat(t[2]),end:parseFloat(t[3])}:null}function Ee(c,t,e,r,i){return r+(i-r)*(c-t)/(e-t)}var Yt=class extends f{constructor(t){super(t),this.htmlKey="progress-part",this.attributesToMap=[...this.attributesToMap,{key:"part-of",type:"string",fallback:""}]}onObjectConnected(t){let e=t.getProperty("part-of"),r=ce(e);if(r){t.setProperty("part-of-id",r.id),t.setProperty("start",r.start),t.setProperty("end",r.end);let i=o=>{if(r){let s=Ee(o,r?.start,r?.end,0,1),n=Math.max(0,Math.min(1,s));t.htmlElement.style.setProperty("--progress-slice",n.toString())}};t.setProperty("progress-event",i),this.events.on(`object:progress:${r.id}`,i)}}onObjectDisconnected(t){let e=t.getProperty("part-of-id");e&&this.events.off(`object:progress:${e}`,t.getProperty("progress-event"))}};var te=class c{constructor(){this.prevWidth=0;this.prevHeight=0;this.loop=new Ft;this.debouncedResize=le(this.onResize,30);this.root=document.body,this.window=window,this.tools=new bt,this.data=new N,this.eventManager=new A,this.moduleManager=new it(this.data),this.objectManager=new ot(this.data,this.moduleManager,this.eventManager),this.centers=new Vt,this.hoverManager=new $t,this.context={events:this.eventManager,data:this.data,tools:this.tools,settings:{},centers:this.centers,hover:this.hoverManager},this.cursorController=new rt(1,this.context),this.scrollManager=new lt(this.context),this.setupSettings({"offset-top":"0%","offset-bottom":"0%",key:"--progress","inview-top":"0%","inview-bottom":"0%","enter-el":"top","enter-vp":"bottom","exit-el":"bottom","exit-vp":"top","parallax-bias":"0.0",parallax:"0.2",lerp:"0.2",radius:"150",strength:"0.3",glide:"1",anchor:"center center",timeout:900,alignment:"center","target-disable":"false","target-style-disable":"false","target-class":"",active:"false",fixed:"false",repeat:"false","self-disable":"false",abs:"false",easing:"cubic-bezier(0.25, 0.25, 0.25, 0.25)","glide-base-velocity":.00125,"glide-reduce-velocity":625e-7,"glide-negative-velocity":-1e-4,"position-strength":3,"position-tension":.05,"position-friction":.15,"position-max-velocity":120,"position-update-threshold":.1,"rotation-strength":.75,"rotation-tension":.06,"rotation-friction":.18,"rotation-max-angular-velocity":6,"rotation-max-angle":18,"rotation-update-threshold":.15,"max-offset":220,"sleep-epsilon":.01,"continuous-push":!0}),this.onContainerTransitionEndBind=this.onContainerTransitionEnd.bind(this),this.onWheelBind=this.onWheelEvent.bind(this),this.onScrollBind=this.onScrollEvent.bind(this),this.onResizeBind=this.onResize.bind(this),this.onMouseMoveBind=this.onMouseMoveEvent.bind(this),this.onScrollStartBind=this.onScrollStart.bind(this),this.onScrollStopBind=this.onScrollStop.bind(this),this.onDirectionChangeBind=this.onDirectionChange.bind(this),this.eventManager.on("wheel",this.onWheelBind),this.scrollManager.bindEvents({onScrollStart:this.onScrollStartBind,onScrollStop:this.onScrollStopBind,onDirectionChange:this.onDirectionChangeBind}),this.loop.setOnFrame(t=>{this.data.time.delta=t-this.data.time.now,this.data.time.previous=this.data.time.now,this.data.time.now=t,this.data.time.elapsed+=this.data.time.delta,this.onUpdateEvent()}),this.on("image:load:all",()=>{this.onResize()}),this.scrollContainer=window}set scrollPosition(t){this.data.scroll.current=t,this.data.scroll.target=t,this.data.scroll.transformedCurrent=this.data.scroll.current*this.data.viewport.transformScale,this.data.scroll.delta=0,this.data.scroll.lerped=0,this.scrollManager.updatePosition(),this.moduleManager.onScroll(),this.objectManager.checkInview()}set scrollContainer(t){this.data.scroll.elementContainer.removeEventListener("transitionend",this.onContainerTransitionEndBind),t instanceof Window?(this.data.scroll.container=document.body,this.data.scroll.elementContainer=document.documentElement,this.data.scroll.scrollContainer=t):t instanceof HTMLElement?(this.data.scroll.container=t,this.data.scroll.elementContainer=t,this.data.scroll.scrollContainer=t):(this.data.scroll.container=document.body,this.data.scroll.elementContainer=document.documentElement,this.data.scroll.scrollContainer=t),this.data.scroll.elementContainer.addEventListener("transitionend",this.onContainerTransitionEndBind),this.debouncedResize()}get speed(){return this.data.scroll.current}set speed(t){this.data.scroll.speed=t}set speedAccelerate(t){this.data.scroll.speedAccelerate=.1+(.5-.1)*t}set scrollDesktopMode(t){this.scrollManager.setDesktopMode(t)}set scrollMobileMode(t){this.scrollManager.setMobileMode(t)}static getInstance(){return c.i||(c.i=new c),c.i}reuse(t){return this.moduleManager.find(t)}use(t,e=null){let r={...this.context.settings,...e},i=new t({events:this.eventManager,data:this.data,tools:this.tools,settings:r,centers:this.centers,hover:this.hoverManager});this.moduleManager.register(i)}on(t,e,r=""){this.eventManager.on(t,e,r)}emit(t,e){this.eventManager.emit(t,e)}off(t,e,r=""){this.eventManager.off(t,e,r)}addScrollMark(t){this.scrollManager.addScrollMark(t)}removeScrollMark(t){this.scrollManager.removeScrollMark(t)}start(t){this.data.scroll.scrollContainer?.addEventListener("scroll",this.onScrollBind),this.data.scroll.container?.addEventListener("wheel",this.onWheelBind,{passive:!1}),window.addEventListener("resize",this.onResizeBind),this.root.addEventListener("mousemove",this.onMouseMoveBind),new ResizeObserver(()=>{this.debouncedResize()}).observe(this.context.data.scroll.container);let r=new MutationObserver((n,a)=>{for(let l of n)l.type==="attributes"&&(l.attributeName==="style"||l.attributeName==="class")&&this.onResize()}),i={attributes:!0,attributeFilter:["style","class"]};r.observe(this.context.data.scroll.container,i),this.use(xt);let o=window.getComputedStyle(document.documentElement).fontSize,s=parseFloat(o);this.context.data.viewport.baseRem=s,document.documentElement.classList.add("-string"),this.moduleManager.onInit(),this.onResize(),this.initObjects(),this.objectManager.observeDOM(),this.loop.start(t),this.eventManager.emit("start",null)}initObjects(){document.querySelectorAll("[string],[data-string]").forEach(t=>{this.objectManager.add(t)}),document.querySelectorAll("[string-copy-from],[data-string-copy-from]").forEach(t=>{let e=this.tools.domAttribute.process({element:t,key:"copy-from",fallback:""});e&&e.length>0&&(this.objectManager.all.has(e)?this.objectManager.all.get(e).connects.push(t):this.objectManager.enqueueConnection(e,t))}),this.moduleManager.onResize(),this.moduleManager.onScroll(),this.moduleManager.onFrame()}setupSettings(t){this.context.settings={...this.context.settings,...t},this.onSettingsChange({isDesktop:this.data.viewport.windowWidth>1080,widthChanged:!0,heightChanged:!0,scrollHeightChanged:!0})}onContainerTransitionEnd(){this.onResize(),this.moduleManager.onResize(),this.moduleManager.onScroll(),this.moduleManager.onFrame()}onMouseMoveEvent(t){this.cursorController.onMouseMove(t),this.moduleManager.onMouseMove(t)}onWheelEvent(t){t.target.closest("[string-isolation],[data-string-isolation]")==null&&(this.scrollManager.get().onWheel(t),this.moduleManager.onWheel(t))}onScrollStart(){this.moduleManager.onScrollStart(),this.eventManager.emit("scroll:start",null)}onScrollStop(){this.moduleManager.onScrollStop(),this.eventManager.emit("scroll:stop",null)}onDirectionChange(){this.moduleManager.onDirectionChange()}onSettingsChange(t){this.cursorController.onSettingsChange(t),this.objectManager.onSettingsChange(t),this.moduleManager.onSettingsChange(t)}onScrollEvent(t){return t.preventDefault(),this.context.centers.invalidateAll(),this.scrollManager.get().onScroll(t),this.moduleManager.onScroll(),this.objectManager.checkInview(),this.eventManager.emit("lerp",this.data.scroll.lerped),this.eventManager.emit("scroll",this.data.scroll.current),!1}onUpdateEvent(){this.cursorController.onFrame(),this.scrollManager.get().onFrame(),this.moduleManager.onFrame(),this.eventManager.emit("update",null)}onResize(t=!1){let e=this.data.scroll.container,r=this.context.data.scroll,i=0,o=0;var s,n=0;let a=e.getBoundingClientRect();e.tagName=="BODY"?(i=window.innerWidth,o=window.innerHeight):(i=a.width,o=a.height),n=a.top,s=r.container.scrollHeight;let l=this.tools.transformScaleParser.process({value:window.getComputedStyle(e).transform});this.context.data.viewport.transformScale=l;let u=i>1080,p=this.prevWidth!==i,d=this.prevHeight!==o,g=this.context.data.viewport.contentHeight!==s,m=p||u&&d||g;this.context.data.scroll.topPosition=n,this.context.data.viewport.contentWidth=i,this.context.data.viewport.contentHeight=s,this.prevWidth=i,this.prevHeight=o,this.context.data.viewport.windowWidth=i,this.context.data.viewport.windowHeight=o;let h=window.getComputedStyle(document.documentElement).fontSize,b=parseFloat(h);this.context.data.viewport.baseRem=b*l,r.bottomPosition=this.context.data.viewport.contentHeight-o,p&&this.moduleManager.onResizeWidth(),(m||typeof t=="boolean"&&t)&&(this.context.data.scroll.container.scrollTop>0&&(this.context.data.scroll.current=this.context.data.scroll.container.scrollTop,this.context.data.scroll.target=this.context.data.scroll.container.scrollTop,this.context.data.scroll.transformedCurrent=this.context.data.scroll.current*this.context.data.viewport.transformScale),this.scrollManager.updateResponsiveMode(),this.moduleManager.onResize(),this.onSettingsChange({isDesktop:u,widthChanged:p,heightChanged:d,scrollHeightChanged:g}),this.moduleManager.onScroll(),this.moduleManager.onFrame())}scrollToElement(t,e=0){let r=document.querySelector(t);if(r){let o=r.getBoundingClientRect().top+window.pageYOffset-this.data.scroll.container.clientTop-e;this.context.data.scroll.delta=o-this.data.scroll.current}else console.warn(`Element not found: ${t}`)}destroy(){this.data.scroll.scrollContainer?.removeEventListener("scroll",this.onScrollBind),this.data.scroll.container?.removeEventListener("wheel",this.onScrollBind),this.data.scroll.elementContainer.removeEventListener("transitionend",this.onContainerTransitionEndBind),this.window.removeEventListener("resize",this.onResizeBind),this.root.removeEventListener("mousemove",this.onMouseMoveBind),this.loop.stop(),this.moduleManager.destroy(),this.eventManager.clearAll(),this.eventManager.off("wheel",this.onWheelBind)}};0&&(module.exports={CursorReactiveModule,StringAnchor,StringCursor,StringData,StringDelayLerpTracker,StringFPSTracker,StringForm,StringGlide,StringImpulse,StringLazy,StringLerp,StringLerpTracker,StringLoading,StringMagnetic,StringModule,StringObject,StringParallax,StringPositionTracker,StringProgress,StringProgressPart,StringResponsive,StringScrollbar,StringScroller,StringSequence,StringSplit,StringTune,StringVideoAutoplay});
|
|
23
|
+
`,document.head.appendChild(t),this.displayElement=e}};function Pe(c,e){let t=null;return function(...r){let i=this;t&&clearTimeout(t),t=setTimeout(()=>{c.apply(i,r),t=null},e)}}var Jt=class{constructor(){this.fps=0;this.isAnimationStarted=!1;this.fpsInterval=0;this.then=0;this.requestAnimationId=0;this.onFrameCallback=e=>{};this.animate=()=>{};this.onVisibilityChangeBind=this.onVisibilityChange.bind(this)}onVisibilityChange(){document.hidden?(this.stop(),this.isAnimationStarted=!1):this.start(this.fps)}start(e){this.fps=e,!this.isAnimationStarted&&(this.fpsInterval=1e3/e,this.then=performance.now(),this.isAnimationStarted=!0,e===0?this.animate=()=>{let t=performance.now();this.requestAnimationId=requestAnimationFrame(()=>this.animate()),this.onFrameCallback(t)}:this.animate=()=>{let t=performance.now(),r=t-this.then;r>this.fpsInterval&&(this.then=t-r%this.fpsInterval,this.onFrameCallback(t)),this.requestAnimationId=requestAnimationFrame(()=>this.animate())},this.animate())}stop(){this.isAnimationStarted&&(cancelAnimationFrame(this.requestAnimationId),this.requestAnimationId=0,this.isAnimationStarted=!1)}setOnFrame(e){this.onFrameCallback=e}destructor(){this.stop()}};var Zt=class extends M{constructor(e){super(e),this.htmlKey="autoplay",this.attributesToMap=[...this.attributesToMap,{key:"src",type:"string",fallback:""}]}onObjectConnected(e){e.setProperty("onEnterEvent",this.onEnterObject.bind(this)),e.events.on("enter",e.getProperty("onEnterEvent")),e.setProperty("onLeaveEvent",this.onLeaveObject.bind(this)),e.events.on("leave",e.getProperty("onLeaveEvent"));let t=e.htmlElement,r=this.tools.domAttribute.process({element:t,key:"string-started",fallback:null})!==null;t.tagName.toLowerCase()==="video"&&!r&&(t.setAttribute("string-started",""),t.muted=!0,t.setAttribute("muted","muted"),t.setAttribute("playsinline",""),t.setAttribute("loop",""),t.setAttribute("autoplay",""),t.src=e.getProperty("src"),t.load(),t.addEventListener("canplay",()=>{}))}onEnterObject(e){let t=e.htmlElement;this.tryPlay(t)}onLeaveObject(e){e.htmlElement.pause()}tryPlay(e){e.play().catch(t=>console.warn("[StringVideoAutoplay] Autoplay failed:",t))}};var me=(r=>(r.ACTIVE="-active",r.HIDE="-hide",r.DISABLE="-disable",r))(me||{});var te=class extends M{constructor(t){super(t);this.activeStepForSlides=new Map;this.hideStepForSlides=new Map;this.htmlKey="sequence",this.attributesToMap=[...this.attributesToMap,{key:"sequence",type:"string",fallback:"string[0]"}]}onInit(){super.onInit(),this.events.on("sequence",({slider:t,step:r})=>{this.objectsOnPage.forEach(n=>{let o=n.getProperty("sequence");o==`${t}[${this.hideStepForSlides.get(t)}]`&&o!=`${t}[${r}]`&&this.setSequenceState(n,"-disable"),o==`${t}[${this.activeStepForSlides.get(t)}]`&&this.setSequenceState(n,"-hide"),o==`${t}[${r}]`&&this.setSequenceState(n,"-active")});let i=this.activeStepForSlides.get(t);i!=null&&this.hideStepForSlides.set(t,i),this.activeStepForSlides.set(t,r)})}onObjectConnected(t){super.onObjectConnected(t),this.setSequenceState(t,"-disable")}setSequenceState(t,r){requestAnimationFrame(()=>{t.htmlElement.classList.remove(...Object.values(me)),t.htmlElement.classList.add(r)})}};var ee=class extends M{constructor(e){super(e),this.htmlKey="form"}initializeObject(e,t,r,i){super.initializeObject(e,t,r,i),t.getProperty("form-events")?.forEach(p=>{p.eventElement.addEventListener("beforeinput",p.eventCallback),p.eventElement.removeEventListener(p.eventType,p.eventCallback)}),t.setProperty("form-events",[]),super.onObjectConnected(t);let n=t.htmlElement,o=["error","group"],s=p=>o.some(u=>p.startsWith(u+"[")),a=Array.from(n.querySelectorAll("[string-input]")).filter(p=>!s(p.getAttribute("string-input")||"")),l={};for(let p=0;p<a.length;p++){let u=a[p],b=this.getInputKey(u,p),m=this.tools.domAttribute.process({element:u,key:"input"})??"";l[b]=this.tools.ruleParser.process({value:m});let h=u instanceof HTMLSelectElement||u instanceof HTMLInputElement&&(u.type==="checkbox"||u.type==="radio")?"change":"input",v=()=>{if(!u.classList.contains("-error"))return;let g=this.getInputKey(u,p),E=l[g],x=this.getFieldValue(u),{valid:S,errors:C}=this.tools.validation.process({rules:E,value:x}),f=n.querySelector(`[string-input="error[${g}]"]`),w=n.querySelector(`[string-input="group[${g}]"]`);if(f){f.innerHTML="";for(let T of C){let P=document.createElement("span");P.textContent=T,f.appendChild(P)}}u.classList.toggle("-error",!S),u.classList.toggle("-valid",S),w&&(w.classList.toggle("-error",!S),w.classList.toggle("-valid",S))},y=g=>{let E=this.getInputKey(u,p),x=l[E],S=u.value,C=u.selectionStart??0,f=u.selectionEnd??0,w=S;switch(g.inputType){case"deleteContentBackward":w=C===f&&C>0?S.slice(0,C-1)+S.slice(f):S.slice(0,C)+S.slice(f);break;case"deleteContentForward":w=C===f&&C<S.length?S.slice(0,C)+S.slice(C+1):S.slice(0,C)+S.slice(f);break;case"insertFromPaste":case"insertFromDrop":case"insertReplacementText":w=S.slice(0,C)+(g.data||"")+S.slice(f);break;default:typeof g.data=="string"&&(w=S.slice(0,C)+g.data+S.slice(f))}let{errors:T}=this.tools.validation.process({rules:x,value:w,type:"beforeinput"});T.length>0&&g.preventDefault()};t.getProperty("form-events").push({eventElement:u,eventType:h,eventCallback:v}),t.getProperty("form-events").push({eventElement:u,eventType:"beforeinput",eventCallback:y}),u.addEventListener("beforeinput",y),u.addEventListener(h,v),u.classList.add("-inited")}let d=p=>{p.preventDefault();let u=!0,b={};for(let m=0;m<a.length;m++){let h=a[m];if(h.disabled||h instanceof HTMLInputElement&&h.type==="hidden")continue;let v=this.getInputKey(h,m),y=l[v],g=this.getFieldValue(h);b[v]=g;let{valid:E,errors:x}=this.tools.validation.process({rules:y,value:g}),S=n.querySelector(`[string-input="error[${v}]"]`),C=n.querySelector(`[string-input="group[${v}]"]`);if(S){S.innerHTML="";for(let f of x){let w=document.createElement("span");w.textContent=f,S.appendChild(w)}}h.classList.toggle("-error",!E),h.classList.toggle("-valid",E),C&&(C.classList.toggle("-error",!E),C.classList.toggle("-valid",E)),E||(u=!1)}if(u)this.events.emit(`form:submit:${t.id}`,b);else{let m=a.find((h,v)=>{let y=this.getInputKey(h,v),g=l[y],E=this.getFieldValue(h),{valid:x}=this.tools.validation.process({rules:g,value:E});return!x});m&&typeof m.focus=="function"&&m.focus(),this.events.emit(`form:invalid:${t.id}`)}};t.getProperty("form-events").push({eventElement:n,eventType:"submit",eventCallback:d}),n.addEventListener("submit",d)}onObjectConnected(e){}getInputKey(e,t){return this.tools.domAttribute.process({element:e,key:"id"})||e.getAttribute("name")||e.getAttribute("id")||`input-${t}`}getFieldValue(e){if(e instanceof HTMLInputElement){if(e.type==="checkbox"){if(e.name){let t=e.form||e.closest("form"),r=t?Array.from(t.querySelectorAll(`input[type="checkbox"][name="${e.name}"]:checked`)):[e];return r.length>1?r.map(i=>i.value):r.length===1?r[0].value:""}return e.checked}if(e.type==="radio"){if(e.name){let r=(e.form||e.closest("form"))?.querySelector(`input[type="radio"][name="${e.name}"]:checked`);return r?r.value:""}return e.checked?e.value:""}return e.value}return e instanceof HTMLSelectElement?e.multiple?Array.from(e.selectedOptions).map(t=>t.value):e.value:e instanceof HTMLTextAreaElement?e.value:""}};var re=class{constructor(){this.map=new WeakMap;this.all=new Set}attach(e){if(this.map.has(e))return;let t=e.htmlElement,r={cx:0,cy:0,valid:!1,el:t};r.ro=new ResizeObserver(()=>{r.valid=!1}),r.ro.observe(t),this.map.set(e,r),this.all.add(e)}detach(e){let t=this.map.get(e);t&&(t.ro?.disconnect(),this.map.delete(e),this.all.delete(e))}invalidateAll(){this.all.forEach(e=>{let t=this.map.get(e);t&&(t.valid=!1)})}getCenter(e){let t=this.map.get(e);if(!t||!t.el)return{cx:0,cy:0};if(!t.valid){let r=t.el.getBoundingClientRect();t.cx=r.left+r.width/2,t.cy=r.top+r.height/2,t.valid=!0}return{cx:t.cx,cy:t.cy}}};var ie=class{constructor(){this.active=new Set;this.subs=new WeakMap}track(e){if(this.subs.has(e))return;let t=e.htmlElement,r=()=>this.active.add(e),i=()=>this.active.delete(e);t.addEventListener("pointerenter",r),t.addEventListener("pointerleave",i),this.subs.set(e,{enter:r,leave:i})}untrack(e){let t=this.subs.get(e);if(!t)return;let r=e.htmlElement;t.enter&&r.removeEventListener("pointerenter",t.enter),t.leave&&r.removeEventListener("pointerleave",t.leave),this.active.delete(e),this.subs.delete(e)}isActive(e){return this.active.has(e)}activeObjects(){return Array.from(this.active)}};var ne=class extends M{constructor(e){super(e),this.htmlKey="scroller"}onObjectConnected(e){let t=e.getProperty("scroller-inited");if(t==null||t==""){e.setProperty("scroller-inited","inited");let r=i=>{this.events.emit("wheel",i)};e.setProperty("scroller-wheel-event",r),e.htmlElement.addEventListener("wheel",r)}}onObjectDisconnected(e){e.setProperty("scroller-inited",""),e.htmlElement.removeEventListener("wheel",e.getProperty("scroller-wheel-event"))}};function we(c){let e=c.match(/([^[]+)\[([\d.]+)-([\d.]+)\]/);return e?{id:e[1],start:parseFloat(e[2]),end:parseFloat(e[3])}:null}function Ue(c,e,t,r,i){return r+(i-r)*(c-e)/(t-e)}var se=class extends M{constructor(e){super(e),this.htmlKey="progress-part",this.attributesToMap=[...this.attributesToMap,{key:"part-of",type:"string",fallback:""}]}onObjectConnected(e){let t=e.getProperty("part-of"),r=we(t);if(r){e.setProperty("part-of-id",r.id),e.setProperty("start",r.start),e.setProperty("end",r.end);let i=n=>{if(r){let o=Ue(n,r?.start,r?.end,0,1),s=Math.max(0,Math.min(1,o));e.htmlElement.style.setProperty("--progress-slice",s.toString()),this.events.emit(`object:progress-slice:${e.id}`,s)}};e.setProperty("progress-event",i),this.events.on(`object:progress:${r.id}`,i)}}onObjectDisconnected(e){let t=e.getProperty("part-of-id");t&&this.events.off(`object:progress:${t}`,e.getProperty("progress-event"))}};var ge=class c{constructor(){this.prevWidth=0;this.prevHeight=0;this.loop=new Jt;this.observerContainerResize=null;this.canRebuild=!0;this.debouncedResize=Pe(this.onResize,30);this.root=document.body,this.window=window,this.tools=new Lt,this.data=new X,this.eventManager=new V,this.moduleManager=new dt(this.data),this.objectManager=new mt(this.data,this.moduleManager,this.eventManager,this.tools),this.centers=new re,this.hoverManager=new ie,this.context={events:this.eventManager,data:this.data,tools:this.tools,settings:{},centers:this.centers,hover:this.hoverManager},this.cursorController=new ut(1,this.context),this.scrollManager=new vt(this.context),this.setupSettings({"global-class":!1,"offset-top":"0%","offset-bottom":"0%",key:"--progress","inview-top":"0%","inview-bottom":"0%","enter-el":"top","enter-vp":"bottom","exit-el":"bottom","exit-vp":"top","parallax-bias":"0.0",parallax:"0.2",lerp:"0.2",radius:"150",strength:"0.3",glide:"1",anchor:"center center",timeout:900,alignment:"center","target-disable":"false","target-style-disable":"false","target-class":"",active:"false",fixed:"false",repeat:"false","self-disable":"false",abs:"false",easing:"cubic-bezier(0.25, 0.25, 0.25, 0.25)","glide-base-velocity":.00125,"glide-reduce-velocity":625e-7,"glide-negative-velocity":-1e-4,"position-strength":3,"position-tension":.05,"position-friction":.15,"position-max-velocity":120,"position-update-threshold":.1,"rotation-strength":.75,"rotation-tension":.06,"rotation-friction":.18,"rotation-max-angular-velocity":6,"rotation-max-angle":18,"rotation-update-threshold":.15,"max-offset":220,"sleep-epsilon":.01,"continuous-push":!0}),this.onContainerTransitionEndBind=this.onContainerTransitionEnd.bind(this),this.onResizeObserverBind=this.onResizeObserverEvent.bind(this),this.observerContainerResize=new ResizeObserver(this.onResizeObserverBind),this.observerContainerResize.observe(this.context.data.scroll.container),this.onWheelBind=this.onWheelEvent.bind(this),this.onScrollBind=this.onScrollEvent.bind(this),this.onResizeBind=this.onResize.bind(this),this.onMouseMoveBind=this.onMouseMoveEvent.bind(this),this.onScrollStartBind=this.onScrollStart.bind(this),this.onScrollStopBind=this.onScrollStop.bind(this),this.onDirectionChangeBind=this.onDirectionChange.bind(this),this.eventManager.on("wheel",this.onWheelBind),this.scrollManager.bindEvents({onScrollStart:this.onScrollStartBind,onScrollStop:this.onScrollStopBind,onDirectionChange:this.onDirectionChangeBind}),this.loop.setOnFrame(e=>{this.data.time.delta=e-this.data.time.now,this.data.time.previous=this.data.time.now,this.data.time.now=e,this.data.time.elapsed+=this.data.time.delta,this.onUpdateEvent()}),this.on("image:load:all",()=>{this.onResize()}),this.scrollContainer=window}set scrollPosition(e){this.data.scroll.current=e,this.data.scroll.target=e,this.data.scroll.transformedCurrent=this.data.scroll.current*this.data.viewport.transformScale,this.data.scroll.delta=0,this.data.scroll.lerped=0,this.scrollManager.updatePosition(),this.moduleManager.onScroll(),this.objectManager.checkInview()}set scrollContainer(e){this.observerContainerResize?.unobserve(this.context.data.scroll.container),this.data.scroll.elementContainer.removeEventListener("transitionend",this.onContainerTransitionEndBind),e instanceof Window?(this.data.scroll.container=document.body,this.data.scroll.elementContainer=document.documentElement,this.data.scroll.scrollContainer=e):e instanceof HTMLElement?(this.data.scroll.container=e,this.data.scroll.elementContainer=e,this.data.scroll.scrollContainer=e):(this.data.scroll.container=document.body,this.data.scroll.elementContainer=document.documentElement,this.data.scroll.scrollContainer=e),this.data.scroll.elementContainer.addEventListener("transitionend",this.onContainerTransitionEndBind),this.observerContainerResize?.observe(this.context.data.scroll.container),this.debouncedResize()}get scrollPosition(){return this.data.scroll.current}get scrollHeight(){return this.data.viewport.contentHeight}get containerHeight(){return this.data.viewport.windowHeight}set speed(e){this.data.scroll.speed=e}set speedAccelerate(e){this.data.scroll.speedAccelerate=.1+(.5-.1)*e}set scrollDesktopMode(e){this.scrollManager.setDesktopMode(e)}set scrollMobileMode(e){this.scrollManager.setMobileMode(e)}static getInstance(){return c.i||(c.i=new c),c.i}reuse(e){return this.moduleManager.find(e)}use(e,t=null){let r={...this.context.settings,...t},i=new e({events:this.eventManager,data:this.data,tools:this.tools,settings:r,centers:this.centers,hover:this.hoverManager});this.moduleManager.register(i)}on(e,t,r=""){this.eventManager.on(e,t,r)}emit(e,t){this.eventManager.emit(e,t)}off(e,t,r=""){this.eventManager.off(e,t,r)}addScrollMark(e){this.scrollManager.addScrollMark(e)}removeScrollMark(e){this.scrollManager.removeScrollMark(e)}start(e){this.data.scroll.scrollContainer?.addEventListener("scroll",this.onScrollBind),this.data.scroll.container?.addEventListener("wheel",this.onWheelBind,{passive:!1}),window.addEventListener("resize",this.onResizeBind),this.root.addEventListener("mousemove",this.onMouseMoveBind);let t=new MutationObserver((o,s)=>{for(let a of o)a.type==="attributes"&&(a.attributeName==="style"||a.attributeName==="class")&&this.onResize()}),r={attributes:!0,attributeFilter:["style","class"]};t.observe(this.context.data.scroll.container,r),this.use(Ht);let i=window.getComputedStyle(document.documentElement).fontSize,n=parseFloat(i);this.context.data.viewport.baseRem=n,document.documentElement.classList.add("-string"),this.moduleManager.onInit(),this.onResize(),this.initObjects(),this.objectManager.observeDOM(),this.loop.start(e),this.eventManager.emit("start",null)}initObjects(){document.querySelectorAll("[string],[data-string]").forEach(e=>{this.objectManager.add(e)}),document.querySelectorAll("[string-copy-from],[data-string-copy-from]").forEach(e=>{let t=this.tools.domAttribute.process({element:e,key:"copy-from",fallback:""});t&&t.length>0&&this.objectManager.linkMirror(t,e)}),this.moduleManager.onResize(),this.moduleManager.onScroll(),this.moduleManager.onFrame()}setupSettings(e){this.context.settings={...this.context.settings,...e},this.onSettingsChange({isDesktop:this.data.viewport.windowWidth>1080,widthChanged:!0,heightChanged:!0,scrollHeightChanged:!0})}onResizeObserverEvent(){this.debouncedResize()}onContainerTransitionEnd(e){e.target===this.context.data.scroll.container&&(this.onResize(),this.moduleManager.onResize(),this.moduleManager.onScroll(),this.moduleManager.onFrame())}onMouseMoveEvent(e){this.cursorController.onMouseMove(e),this.moduleManager.onMouseMove(e),N.measure(()=>{this.moduleManager.onMouseMoveMeasure()})}onWheelEvent(e){e.target.closest("[string-isolation],[data-string-isolation]")==null&&(this.scrollManager.get().onWheel(e),this.moduleManager.onWheel(e))}onScrollStart(){this.moduleManager.onScrollStart(),this.eventManager.emit("scroll:start",null)}onScrollStop(){this.moduleManager.onScrollStop(),this.eventManager.emit("scroll:stop",null)}onDirectionChange(){this.moduleManager.onDirectionChange()}onSettingsChange(e){this.cursorController.onSettingsChange(e),this.objectManager.onSettingsChange(e),this.moduleManager.onSettingsChange(e)}onScrollEvent(e){return e.preventDefault(),this.context.centers.invalidateAll(),this.scrollManager.get().onScroll(e),this.moduleManager.onScroll(),this.objectManager.checkInview(),this.eventManager.emit("lerp",this.data.scroll.lerped),this.eventManager.emit("scroll",this.data.scroll.current),N.measure(()=>{this.moduleManager.onScrollMeasure()}),!1}onUpdateEvent(){this.cursorController.onFrame(),this.scrollManager.get().onFrame(),this.moduleManager.onFrame(),N.mutate(()=>{L.begin(),this.moduleManager.onMutate(),L.commit()}),this.eventManager.emit("update",null)}onResize(e=!1){if(this.canRebuild==!1)return;let t=this.data.scroll.container,r=this.context.data.scroll,i=0,n=0;var o,s=0;let a=t.getBoundingClientRect();t.tagName=="BODY"?(i=window.innerWidth,n=window.innerHeight):(i=a.width,n=a.height),s=a.top,o=r.container.scrollHeight;let l=this.tools.transformScaleParser.process({value:window.getComputedStyle(t).transform});this.context.data.viewport.transformScale=window.getComputedStyle(t).scale=="none"?l:Number(window.getComputedStyle(t).scale),this.context.data.scroll.transformedCurrent=this.context.data.scroll.current*this.context.data.viewport.transformScale;let d=i>1080,p=this.prevWidth!==i,u=this.prevHeight!==n,b=this.context.data.viewport.contentHeight!==o,m=p||d&&u||b;this.context.data.scroll.topPosition=Math.floor(s),this.context.data.viewport.contentWidth=i,this.context.data.viewport.contentHeight=o,this.prevWidth=i,this.prevHeight=n,this.context.data.viewport.windowWidth=i,this.context.data.viewport.windowHeight=n;let h=window.getComputedStyle(document.documentElement).fontSize,v=parseFloat(h);this.context.data.viewport.baseRem=v*l,r.bottomPosition=this.context.data.viewport.contentHeight-n,(p||typeof e=="boolean"&&e)&&this.moduleManager.onResizeWidth(),(m||typeof e=="boolean"&&e)&&(this.context.data.scroll.container.scrollTop>0&&(this.context.data.scroll.current=this.context.data.scroll.container.scrollTop,this.context.data.scroll.target=this.context.data.scroll.container.scrollTop),this.scrollManager.updateResponsiveMode(),this.moduleManager.onResize(),this.onSettingsChange({isDesktop:d,widthChanged:p,heightChanged:u,scrollHeightChanged:b}),this.moduleManager.onScroll(),this.moduleManager.onFrame())}scrollToElement(e,t=0){let r=document.querySelector(e);if(r){let n=r.getBoundingClientRect().top+window.pageYOffset-this.data.scroll.container.clientTop-t;this.context.data.scroll.delta=n-this.data.scroll.current}else console.warn(`Element not found: ${e}`)}scrollTo(e){this.scrollManager.get().scrollTo(e)}invalidateCenters(){this.centers.invalidateAll()}destroy(){this.data.scroll.scrollContainer?.removeEventListener("scroll",this.onScrollBind),this.data.scroll.container?.removeEventListener("wheel",this.onScrollBind),this.data.scroll.elementContainer.removeEventListener("transitionend",this.onContainerTransitionEndBind),this.window.removeEventListener("resize",this.onResizeBind),this.root.removeEventListener("mousemove",this.onMouseMoveBind),this.loop.stop(),this.moduleManager.destroy(),this.eventManager.clearAll(),this.eventManager.off("wheel",this.onWheelBind)}};0&&(module.exports={CursorReactiveModule,StringAnchor,StringCursor,StringData,StringDelayLerpTracker,StringFPSTracker,StringForm,StringGlide,StringImpulse,StringLazy,StringLerp,StringLerpTracker,StringLoading,StringMagnetic,StringModule,StringObject,StringParallax,StringPositionTracker,StringProgress,StringProgressPart,StringResponsive,StringScrollbar,StringScroller,StringSequence,StringSplit,StringSpotlight,StringTune,StringVideoAutoplay,frameDOM,styleTxn});
|
|
24
24
|
//# sourceMappingURL=index.cjs.map
|