@fiddle-digital/string-tune 1.1.3 → 1.1.5
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 +15 -1
- package/dist/index.d.ts +15 -1
- 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 At=Object.defineProperty;var Xt=Object.getOwnPropertyDescriptor;var jt=Object.getOwnPropertyNames;var Kt=Object.prototype.hasOwnProperty;var Qt=(l,e)=>{for(var t in e)At(l,t,{get:e[t],enumerable:!0})},Gt=(l,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of jt(e))!Kt.call(l,i)&&i!==t&&At(l,i,{get:()=>e[i],enumerable:!(r=Xt(e,i))||r.enumerable});return l};var Jt=l=>Gt(At({},"__esModule",{value:!0}),l);var ne={};Qt(ne,{StringAnchor:()=>gt,StringCursor:()=>ct,StringData:()=>R,StringDelayLerpTracker:()=>Ct,StringFPSTracker:()=>Tt,StringGlide:()=>ft,StringLazy:()=>pt,StringLerp:()=>bt,StringLerpTracker:()=>wt,StringLoading:()=>ut,StringMagnetic:()=>dt,StringModule:()=>g,StringObject:()=>O,StringParallax:()=>vt,StringPositionTracker:()=>Lt,StringProgress:()=>k,StringResponsive:()=>ht,StringScrollbar:()=>Mt,StringSplit:()=>Et,StringTune:()=>Ft,StringVideoAutoplay:()=>It,default:()=>Ft});module.exports=Jt(ne);var K=class{constructor(e=.1,t){this.SETTLE_THRESHOLD=.1;this.smoothingFactor=e,this.context=t,this.onSettingsChange()}onMouseMove(e){this.context.data.cursor.targetX=e.clientX,this.context.data.cursor.targetY=e.clientY}onFrame(){let{targetX:e,targetY:t,smoothedX:r,smoothedY:i}=this.context.data.cursor,o=this.context.tools.lerp.process({from:r,to:e,progress:this.smoothingFactor}),n=this.context.tools.lerp.process({from:i,to:t,progress:this.smoothingFactor}),s=this.getStepDistance(o,n);this.isSettled(s)?this.snapToTarget():this.applyStep(o,n)}onSettingsChange(){let e=Number(this.context.settings.lerp);this.setLerpFactor(e)}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 I=class{constructor(){this.listeners={}}on(e,t,r){let i=r?`${e}_${r}`:e;this.listeners[i]||(this.listeners[i]=new Set),this.listeners[i].add(t)}off(e,t,r){let i=r?`${e}_${r}`:e;this.listeners[i]&&this.listeners[i].delete(t)}emit(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={}}};var Q=class{constructor(e){this.data=e;this.modules=[];this.uiModules=[]}register(e){e.type===1&&this.modules.push(e),e.type===2&&this.uiModules.push(e)}find(e){return this.modules.find(t=>t instanceof e)}onInit(){[...this.modules,...this.uiModules].forEach(e=>e.onInit())}onFrame(){[...this.modules,...this.uiModules].forEach(e=>e.onFrame(this.data))}onScroll(){[...this.modules,...this.uiModules].forEach(e=>e.onScroll(this.data))}onResize(){[...this.modules,...this.uiModules].forEach(e=>e.onResize())}onMouseMove(e){[...this.modules,...this.uiModules].forEach(t=>t.onMouseMove(e))}onWheel(e){[...this.modules,...this.uiModules].forEach(t=>t.onWheel(e))}onDirectionChange(){[...this.modules,...this.uiModules].forEach(e=>e.onDirectionChange())}onScrollStart(){[...this.modules,...this.uiModules].forEach(e=>e.onScrollStart())}onScrollStop(){[...this.modules,...this.uiModules].forEach(e=>e.onScrollStop())}onAxisChange(){[...this.modules,...this.uiModules].forEach(e=>e.onAxisChange())}onDeviceChange(){[...this.modules,...this.uiModules].forEach(e=>e.onDeviceChange())}onScrollConfigChange(){[...this.modules,...this.uiModules].forEach(e=>e.onScrollConfigChange())}onSettingsChange(){[...this.modules,...this.uiModules].forEach(e=>e.onSettingsChange())}onDOMMutate(e,t){[...this.modules,...this.uiModules].forEach(r=>r.onDOMMutate(e,t))}destroy(){[...this.modules,...this.uiModules].forEach(e=>e.destroy()),this.modules=[],this.uiModules=[]}get all(){return[...this.modules,...this.uiModules]}get core(){return this.modules}get ui(){return this.uiModules}};var O=class{constructor(e,t){this.id="";this.keys=[];this.connects=[];this.properties=new Map;this.modules=[];this.events=new I;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)}};var G=class{constructor(e,t,r){this.data=e;this.modules=t;this.events=r;this.objects=new Map;this.connectQueue=[];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 O(t,e);e.setAttribute(r,i.id);let o=e.getAttribute("string")??e.getAttribute("data-string");o&&(i.keys=(o??"").split("|")),e.setAttribute("string-inited",""),this.objects.set(i.id,i);let n=this.getAllAttributes(e);this.modules.core.forEach(a=>{"setupCoreProperties"in a&&typeof a.setupCoreProperties=="function"&&a.setupCoreProperties(i,e,n)}),this.modules.core.forEach(a=>{a.canConnect(i)&&(a.initializeObject(this.globalId,i,e,n),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,e)}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(),this.objects.delete(e))}enqueueConnection(e,t){this.connectQueue.push({id:e,element:t})}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,o=e.getProperty("inview-top")??0,n=e.getProperty("inview-bottom")??0;e.getProperty("observer-progress")?.disconnect(),e.getProperty("observer-inview")?.disconnect();let s=c=>{c.forEach(p=>{this.events.emit(`object:activate:${e.id}`,p.isIntersecting),p.isIntersecting?e.enter():e.leave()})},a=c=>{c.forEach(p=>{this.events.emit(`object:inview:${e.id}`,p.isIntersecting),p.isIntersecting?e.show():e.hide()})},u=new IntersectionObserver(s,{root:null,rootMargin:`${i+this.data.viewport.windowHeight}px 0px ${r+this.data.viewport.windowHeight}px 0px`,threshold:.001}),d=new IntersectionObserver(a,{root:null,rootMargin:`${r+o+e.getProperty("end-bias")}px 0px ${i+n+e.getProperty("start-bias")}px 0px`,threshold:.001});u.observe(t),d.observe(t),e.setProperty("observer-progress",u),e.setProperty("observer-inview",d)}observeDOM(){new MutationObserver(t=>{t.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(n=>{this.isFixed(n)||this.handleRemoved(n)}))}),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(s=>this.add(s));let n=o.getAttribute("string-copy-from")??o.getAttribute("data-string-copy-from");n&&(this.objects.has(n)?this.objects.get(n).connects.push(o):this.enqueueConnection(n,o))}),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(){this.objects.forEach(e=>{this.modules.core.forEach(t=>{if(t.canConnect(e)){let r=this.getAllAttributes(e.htmlElement);t.initializeObject(this.globalId,e,e.htmlElement,r),t.calculatePositions(e,this.data.viewport.windowHeight),t.connectObject(e)}})})}isFixed(e){return e.hasAttribute("string-fixed")}};var C=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)}};var J=class extends C{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}}};var Z=class extends C{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 w={SCROLL_FORWARD:"-scroll-forward",SCROLL_BACKWARD:"-scroll-backward",SCROLLING_FORWARD:"-scrolling-forward",SCROLLING_BACKWARD:"-scrolling-backward"};var tt=class extends C{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(),document.documentElement.classList.toggle(w.SCROLLING_FORWARD,t),document.documentElement.classList.toggle(w.SCROLLING_BACKWARD,!t),document.documentElement.classList.toggle(w.SCROLL_FORWARD,t),document.documentElement.classList.toggle(w.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(w.SCROLLING_BACKWARD,w.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,o=this.context.data.scroll.target===this.context.data.scroll.bottomPosition&&r>0;i||o||(this.context.data.scroll.delta+=this.wheelImpulse)}onScroll(t){this.isProg||(this.isScrollbarManipulation=!0)}};var et=class{constructor(e){this.context=e;this.modes=new Map;this.modes.set("smooth",new tt(e)),this.modes.set("default",new J(e)),this.modes.set("disable",new Z(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 rt=class{constructor(){this.targetX=0;this.targetY=0;this.smoothedX=0;this.smoothedY=0;this.stepX=0;this.stepY=0}};var it=class{constructor(){this.threeInstance=null}};var ot=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 nt=class{constructor(){this.now=0;this.previous=0;this.delta=0;this.elapsed=0}};var st=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 R=class{constructor(){this.scroll=new ot;this.viewport=new st;this.cursor=new rt;this.render=new it;this.time=new nt}};var g=class{constructor(e){this.objectMapOnPage=new Map;this.objectsOnPage=[];this.objectMap=new Map;this.objects=[];this.htmlKey="";this._type=1;this.tools=e.tools,this.data=e.data,this.settings=e.settings,this.events=e.events,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:(t,r,i)=>{let o=i.top;return Math.floor(o)+this.data.scroll.container.scrollTop*this.data.viewport.transformScale}},{key:"end",type:"number",fallback:(t,r,i)=>{let o=i.top,n=i.height;return o+n-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}]}get type(){return this._type}initializeObject(e,t,r,i){let o=this.tools.boundingClientRect.process({element:r});for(let{key:n,type:s,fallback:a,transform:u}of this.attributesToMap){let d=typeof a=="function"?a(r,t,o):a,c=this.tools.domAttribute.process({element:r,key:n,fallback:i[n]??this.settings[n]??d}),p=this.parseAttribute(c,s,{element:r,viewportHeight:this.data.viewport.windowHeight,baseRem:this.data.viewport.baseRem});u&&(p=u(p)),t.setProperty(n,p)}}calculatePositions(e,t){let r=e.getProperty("start"),i=e.getProperty("size"),o=e.getProperty("offset-bottom"),n=e.getProperty("offset-top"),s=e.getProperty("enter-el"),a=e.getProperty("enter-vp"),u=e.getProperty("exit-el"),d=e.getProperty("exit-vp"),c=0,p=0,m=0,f=0;s==="top"&&a==="top"||s==="left"&&a==="left"?(m=-t+1,c=r-o):s==="top"&&a==="bottom"||s==="left"&&a==="right"?c=r-t-o:s==="bottom"&&a==="top"||s==="right"&&a==="left"?(m=-t-i+1,c=r+i-o):(s==="bottom"&&a==="bottom"||s==="right"&&a==="right")&&(m=-i+1,c=r-t+i-o),u==="top"&&d==="top"||u==="left"&&d==="left"?(f=-i+1,p=r+n):u==="top"&&d==="bottom"||u==="left"&&d==="right"?(f=-t-i+1,p=r-t+n):u==="bottom"&&d==="top"||u==="right"&&d==="left"?p=r+i+n:(u==="bottom"&&d==="bottom"||u==="right"&&d==="right")&&(f=-t+1,p=r-t+i+n),e.setProperty("start-bias",m),e.setProperty("end-bias",f),e.setProperty("start-position",c-this.data.scroll.topPosition),e.setProperty("end-position",p),e.setProperty("difference-position",p-c)}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?this.tools.unitParser.process({value:e,element:r.element,viewportHeight:r.viewportHeight,baseRem:r.baseRem}):0;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)}onObjectConnected(e){}applyToElementAndConnects(e,t){t(e.htmlElement),e.connects.forEach(t)}destroy(){this.objects=[],this.objectMap=new Map}onInit(){}onFrame(e){}onResize(){}onScroll(e){}onDirectionChange(){}onScrollStart(){}onScrollStop(){}onScrollDirectionChange(){}onAxisChange(){}onDeviceChange(){}onScrollConfigChange(){}onSettingsChange(){}onDOMRebuild(){}onMouseMove(e){}onWheel(e){}onDOMMutate(e,t){}};var A=class{process({element:e}){return e.getBoundingClientRect()}};var H=class{process({element:e,key:t,fallback:r=null}){return e.getAttribute(`string-${t}`)??e.getAttribute(`data-string-${t}`)??r}};var F=class{process({record:e,name:t,fallback:r=null}){return e[t]??e[`data-${t}`]??r}};var L=class{process({element:e}){let t=e.getBoundingClientRect(),i=getComputedStyle(e).transform.match(/-?[\d.]+/g)?.map(parseFloat)??[];if(i.length===6){let[o,n,s,a,u,d]=i,c=o*a-n*s;return{width:t.width/(o||1),height:t.height/(a||1),left:(t.left*a-t.top*s+s*d-u*a)/c,top:(-t.left*n+t.top*o+u*n-o*d)/c}}return t}};var N=class{constructor(e=new L){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 V=class{process({from:e,to:t,progress:r}){return(t-e)*r}};var W=class{process({value:e,element:t,viewportHeight:r,baseRem:i}){let o=e.startsWith("-");o&&(e=e.slice(1));let n=0;return e==="selfHeight"?n=t.offsetHeight:e.endsWith("px")?n=parseFloat(e):e.endsWith("%")?n=parseFloat(e)/100*r:e.endsWith("rem")&&(n=parseFloat(e)*i),o?-n:n}};var B=class{process({value:e,inMin:t=.1,inMax:r=1,outMin:i=.05,outMax:o=.65}){if(e<t)return o;if(e>1&&(e=1),e<=r){let n=(e-t)/(r-t);return o-n*(o-i)}return i}};var z=class{process({value:e}){let t=e.trim();if(t.startsWith("random(")&&t.endsWith(")")){let r=t.slice(7,-1).split(",").map(o=>o.trim()).filter(Boolean),i=Math.floor(Math.random()*r.length);return r[i]}return t}};var q=class{process({value:e}){let t=e.trim().toLowerCase();if(t.startsWith("#")){let o=t.slice(1);o.length===3&&(o=o.split("").map(d=>d+d).join(""));let n=parseInt(o.slice(0,2),16),s=parseInt(o.slice(2,4),16),a=parseInt(o.slice(4,6),16),u=o.length===8?parseInt(o.slice(6,8),16)/255:1;return{r:n,g:s,b:a,a:u}}let r=t.match(/rgba?\(([^)]+)\)/);if(r){let[o,n,s,a=1]=r[1].split(",").map(u=>parseFloat(u.trim()));return{r:o,g:n,b:s,a}}let i=t.match(/hsla?\(([^)]+)\)/);if(i){let[o,n,s,a="1"]=i[1].split(",").map(p=>p.trim()),[u,d,c]=this.hslToRgb(parseFloat(o),parseFloat(n),parseFloat(s));return{r:u,g:d,b:c,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,c,p)=>(p<0&&(p+=1),p>1&&(p-=1),p<1/6?d+(c-d)*6*p:p<1/2?c:p<2/3?d+(c-d)*(2/3-p)*6:d),o=r<.5?r*(1+t):r+t-r*t,n=2*r-o,s=Math.round(i(n,o,e+1/3)*255),a=Math.round(i(n,o,e)*255),u=Math.round(i(n,o,e-1/3)*255);return[s,a,u]}};var $=class{process({value:e,rules:t,messages:r={}}){for(let i of t){let o=null;if(i==="required"&&e.trim()===""?o="required":i==="email"&&!/^\S+@\S+\.\S+$/.test(e)?o="invalid-email":typeof i=="object"&&(i.type==="minLength"&&e.length<i.value&&(o="too-short"),i.type==="maxLength"&&e.length>i.value&&(o="too-long")),o){let n=r[o],s=typeof n=="function"?n({value:e,rule:i}):n??this.defaultMessage(o,i);return{valid:!1,error:o,message:s}}}return{valid:!0,error:null,message:null}}defaultMessage(e,t){switch(e){case"required":return"This field is required.";case"invalid-email":return"Please enter a valid email.";case"too-short":return`Too short${typeof t=="object"&&"value"in t?` (min ${t.value})`:""}.`;case"too-long":return`Too long${typeof t=="object"&&"value"in t?` (max ${t.value})`:""}.`}}};var _=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,o,n,s]=r.slice(1).map(Number);return this.cubicBezier(i,o,n,s)}return i=>i}cubicBezier(e,t,r,i){let o=3*e,n=3*(r-e)-o,s=1-o-n,a=3*t,u=3*(i-t)-a,d=1-a-u;function c(h){return((s*h+n)*h+o)*h}function p(h){return((d*h+u)*h+a)*h}function m(h){return(3*s*h+2*n)*h+o}function f(h,S=1e-5){let y,M,b=h,v,x,T;for(T=0;T<8;T++){if(v=c(b)-h,Math.abs(v)<S)return b;if(x=m(b),Math.abs(x)<1e-6)break;b=b-v/x}for(y=0,M=1,b=h;y<M;){if(v=c(b)-h,Math.abs(v)<S)return b;v>0?M=b:y=b,b=(M+y)/2}return b}return function(h){return p(f(h))}}};var Y=class{process({distance:e,radius:t,strength:r}){if(e>=t)return 0;let i=(t-e)/t;return r*i}};var U=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 X=class{process({from:e,to:t,progress:r}){return{x:(t.x-e.x)*r,y:(t.y-e.y)*r}}};var j=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 o=i[1].split(",").map(n=>parseFloat(n.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(n=>parseFloat(n.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(n=>parseFloat(n.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(n=>parseFloat(n.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 at=class{process({attributeValue:e}){let t={line:[],word:[],char:[],charLine:[],charWord:[],wordLine:[]};return e&&e.split("|").forEach(i=>{let o=i.trim();if(!o)return;let n=o.match(/^(\w+-)?(\w+)(\[(.*?)\])?$/);if(n){let s=n[1]||"",a=n[2],u=s+a,c=(n[4]||"").split(";").map(m=>m.trim()).filter(m=>m.length>0),p=this.parseParamsArray(c);switch(u){case"line":t.line.push(p);break;case"word":t.word.push(p);break;case"char":t.char.push(p);break;case"charLine":t.charLine.push(p);break;case"charWord":t.charWord.push(p);break;case"wordLine":t.wordLine.push(p);break;default:console.warn(`SplitOptionsParserTool: Unrecognized option type "${u}" in part "${o}"`);break}}else console.warn(`SplitOptionsParserTool: Could not parse part format "${o}"`)}),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 lt=class{constructor(){this.domAttribute=new H;this.recordAttribute=new F;this.transformNullify=new L;this.boundingClientRect=new A;this.relativePosition=new N(this.transformNullify);this.unitParser=new W;this.lerp=new V;this.adaptiveLerp=new B;this.originParser=new z;this.colorParser=new q;this.validation=new $;this.easingFunction=new _;this.magneticPull=new Y;this.lerpColor=new U;this.lerpVector=new X;this.transformScaleParser=new j;this.optionsParser=new at}};var ct=class extends g{constructor(t){super(t);this.enterObjectsMap=new Map;this.enterObjects=new Array;this.overCount=0;this.htmlKey="cursor",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,o){super.initializeObject(t,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(t){requestAnimationFrame(()=>{this.objects.forEach(s=>{let a=s.getProperty("is-mouse-over"),u=s.getProperty("cursor-target-disable"),d=s.getProperty("lerp")??.15;if(a&&!u){let c=s.htmlElement.getBoundingClientRect(),p=this.data.cursor.targetX,m=this.data.cursor.targetY,f=p-c.left,h=m-c.top,S=s.getProperty("mouse-pixel-x")??0,y=s.getProperty("mouse-pixel-y")??0,M=S-f,b=y-h;if(M*M+b*b>1e-4){(s.getProperty("is-mouse-move")??!1)||(s.setProperty("is-mouse-move",!0),s.setProperty("mouse-pixel-x",f),s.setProperty("mouse-pixel-y",h),s.setProperty("mouse-x",f),s.setProperty("mouse-y",h),S=f,y=h,this.events.emit(`cursor:start:${s.id}`,null));let T=this.tools.lerp.process({from:S,to:f,progress:d}),Ut=this.tools.lerp.process({from:y,to:h,progress:d}),Ot=S+T,Dt=y+Ut;s.setProperty("mouse-pixel-x",Ot),s.setProperty("mouse-pixel-y",Dt);let Nt=s.getProperty("alignment")??"center",kt=this.calculateOffset(Nt,Ot,c.width),Rt=this.calculateOffset(Nt,Dt,c.height);s.setProperty("mouse-x",kt),s.setProperty("mouse-y",Rt),this.setMouseCoordinates(s,kt,Rt),this.events.emit(`cursor:move:${s.id}`,{x:kt,y:Rt}),this.events.emit(`cursor:pixel:${s.id}`,{x:Ot,y:Dt})}else s.setProperty("mouse-pixel-x",f),s.setProperty("mouse-pixel-y",h),this.events.emit(`cursor:end:${s.id}`,null)}else{let c=s.getProperty("mouse-x")??0,p=s.getProperty("mouse-y")??0;if(c!==0||p!==0){s.setProperty("is-mouse-move",!1);let m=s.htmlElement.getBoundingClientRect(),f=s.getProperty("half-width")??m.width/2,h=s.getProperty("half-height")??m.height/2,S=this.calculateOffset("center",f,m.width),y=this.calculateOffset("center",h,m.height),M=c+this.tools.lerp.process({from:c,to:S,progress:d}),b=p+this.tools.lerp.process({from:p,to:y,progress:d});s.setProperty("mouse-x",M),s.setProperty("mouse-y",b),Math.abs(M)<.001&&Math.abs(b)<.001&&(s.setProperty("mouse-x",0),s.setProperty("mouse-y",0),s.setProperty("mouse-pixel-x",0),s.setProperty("mouse-pixel-y",0)),this.setMouseCoordinates(s,M,b)}}});let{stepX:r,stepY:i,smoothedX:o,smoothedY:n}=this.data.cursor;(r!==0||i!==0)&&(this.events.emit("cursor",{stepX:r,stepY:i,x:o,y:n}),this.cursor.style.setProperty("--x",o.toString()),this.cursor.style.setProperty("--y",n.toString()),this.cursor.style.setProperty("--x-lerp",r.toString()),this.cursor.style.setProperty("--y-lerp",i.toString()))})}onObjectConnected(t){let r=t.htmlElement;t.setProperty("timeoutId",null),t.setProperty("mouseleave",()=>{this.onMouseLeave(t)}),t.setProperty("mouseenter",()=>{this.onMouseEnter(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"))}getCursorClass(t){let r=t.getProperty("cursor-class");return r!=null&&r.length>0?r:null}onMouseEnter(t){this.overCount++,t.setProperty("is-mouse-over",!0);let r=this.getCursorClass(t);r&&this.cursor.classList.add(r),this.cursor.classList.add("-showing"),t.setProperty("timeoutId",setTimeout(()=>{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);r&&this.cursor.classList.remove(r),this.cursor.classList.remove("-showing"),this.cursor.classList.remove("-show"),t.htmlElement.removeEventListener("mouseleave",t.getProperty("mouseleave"))}onEnterObject(t){t.htmlElement.addEventListener("mouseenter",t.getProperty("mouseenter"))}onLeaveObject(t){t.htmlElement.removeEventListener("mouseenter",t.getProperty("mouseenter")),t.htmlElement.removeEventListener("mouseleave",t.getProperty("mouseleave"))}setMouseCoordinates(t,r,i){t.getProperty("cursor-target-style-disable")||this.applyToElementAndConnects(t,o=>{o.style.setProperty("--x",r.toFixed(2)),o.style.setProperty("--y",i.toFixed(2))})}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 dt=class extends g{constructor(e){super(e),this.htmlKey="magnetic",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(),o=i.left+(t.getProperty("half-width")??0),n=i.top+(t.getProperty("half-height")??0),s=e.clientX-o,a=e.clientY-n,u=Math.sqrt(s**2+a**2),d=t.getProperty("radius")??0,c=t.getProperty("strength")??0,p=this.tools.magneticPull.process({distance:u,radius:d,strength:c});t.setProperty("magnetic-target-x",s*p),t.setProperty("magnetic-target-y",a*p),p>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,o=t.getProperty("lerp")??0,n=t.getProperty("magnetic-target-x")??0,s=t.getProperty("magnetic-target-y")??0,a=this.tools.lerp.process({from:r,to:n,progress:o}),u=this.tools.lerp.process({from:i,to:s,progress:o});a>-.01&&a<.01&&(a=0,t.setProperty("magnetic-x",t.getProperty("magnetic-target-x"))),u>-.01&&u<.01&&(u=0,t.setProperty("magnetic-y",t.getProperty("magnetic-target-y"))),r+=a,i+=u,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 pt=class extends g{constructor(t){super(t);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(t){if(this.loadingCount++,this.isStartLoaded){let r=t.htmlElement;this.loadImage(r)}}async loadImage(t){let r=this.tools.domAttribute.process({element:t,key:this.htmlKey,fallback:""});if(r)try{t.classList.add("lazyLoad"),t.src=r,t.addEventListener("load",()=>{t.classList.add("-loaded")}),await this.setAspectRatio(t,r)}catch{console.warn("Failed to load image:",r)}}setAspectRatio(t,r){return new Promise((i,o)=>{let n=new XMLHttpRequest;n.open("GET",r,!0),n.responseType="arraybuffer",n.setRequestHeader("Range","bytes=0-"),n.onload=()=>{if(n.status===200||n.status===206){let s=new Blob([n.response]),a=new Image;a.onload=()=>{t.style.aspectRatio=`${a.width} / ${a.height}`,URL.revokeObjectURL(a.src),this.loadingCount--,this.loadingCount<=0&&(this.events.emit("image:load:all",null),this.loadingCount=0),i()},a.onerror=()=>{URL.revokeObjectURL(a.src),this.loadingCount--,o(new Error("Image failed to decode"))},a.src=URL.createObjectURL(s)}else o(new Error("Image request failed"))},n.onerror=()=>o(new Error("XHR error")),n.send()})}};var ut=class extends g{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 mt=class extends g{constructor(e){super(e),this.htmlKey=""}canConnect(e){return e.keys[0]==null}};var D=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}},ht=class extends g{constructor(t){super(t);this.queries={0:new D({max:359}),1:new D({min:360,max:1079}),2:new D({min:1080,max:1365}),3:new D({min:1366})};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.mobile.min==null?null:t.mobile.min,t.mobile.max??null),this.matchMedias[1]=window.matchMedia(this.queries[0].mediaQuery)):this.queries[1].enable=!1,t.laptop?(this.queries[2].enable=!0,this.queries[2].setRange(t.mobile.min==null?null:t.mobile.min,t.mobile.max??null),this.matchMedias[2]=window.matchMedia(this.queries[0].mediaQuery)):this.queries[2].enable=!1,t.desktop?(this.queries[3].enable=!0,this.queries[3].setRange(t.mobile.min==null?null:t.mobile.min,t.mobile.max??null),this.matchMedias[3]=window.matchMedia(this.queries[0].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,o=this.matchMedias[3].matches&&this.queries[3].enable;document.querySelectorAll("[string-mobile], [string-tablet], [string-laptop], [string-desktop]").forEach(s=>{let a=!1;s.hasAttribute("string-mobile")&&t&&(a=!0,this.events.emit("screen:mobile",t)),s.hasAttribute("string-tablet")&&r&&(a=!0,this.events.emit("screen:tablet",r)),s.hasAttribute("string-laptop")&&i&&(a=!0,this.events.emit("screen:laptop",i)),s.hasAttribute("string-desktop")&&o&&(a=!0,this.events.emit("screen:desktop",o)),a?s.style.display=null:s.style.display="none"})}};var gt=class extends g{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,o=this.tools.originParser.process({value:r}),n=this.tools.originParser.process({value:i});return{x:o,y:n}}}]}onObjectConnected(e){super.onObjectConnected(e);let t=e.getProperty("anchor");t&&this.applyToElementAndConnects(e,r=>{r.style.transformOrigin=`${t.x} ${t.y}`})}};var Zt=.05,te=.01,Vt=1,ee=-1,re=1,ft=class extends g{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 o=`translate3d(0, ${i}px, 0)`;t.htmlElement.style.transform=o};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(Vt,this.acceleration+Zt),this.displacement=Math.max(te,Math.min(Vt,this.displacement+this.velocityMultiplier)),this.data.scroll.displacement=Math.min(re,Math.max(ee,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 bt=class extends g{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 k=class extends g{constructor(e){super(e),this.htmlKey="progress",this.attributesToMap=[...this.attributesToMap,{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"]},{key:"easing",type:"easing",fallback:this.settings.easing}]}initializeObject(e,t,r,i){super.initializeObject(e,t,r,i)}onScroll(e){super.onScroll(e),this.objects.forEach(t=>{this.setUpObject(t)})}onObjectConnected(e){super.onObjectConnected(e),e.setProperty("setUpObject",this.setUpObject.bind(this)),e.events.on("enter",e.getProperty("setUpObject"))}setUpObject(e){let t=e.getProperty("start-position"),r=e.getProperty("difference-position"),i=e.getProperty("key"),o=e.getProperty("easing")(Math.min(1,Math.max(0,(this.data.scroll.transformedCurrent-t)/r)));if(e.getProperty("progress")!==o){this.events.emit(`object:progress:${e.id}`,o),e.setProperty("progress",o);let n=o.toString();this.applyToElementAndConnects(e,s=>{s.style.setProperty(i,n)})}}};var vt=class extends k{constructor(t){super(t);this.handleScrollDesktop=()=>{this.objects.forEach(t=>{let r=t.getProperty("progress")??0,i=t.getProperty("parallax")??0,o=t.getProperty("parallax-position-start")??0,n=t.getProperty("parallax-position-end")??1,s=this.data.viewport.windowHeight,a=i*s*o+r*i*s*n;this.events.emit(`object:parallax:${t.id}`,a);let u=`translate3d(0, ${a}px, 0)`;this.applyToElementAndConnects(t,d=>{d.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(t,r,i,o){super.initializeObject(t,r,i,o);let n=r.getProperty("parallax-bias")??0,s=r.getProperty("parallax")??.2;r.setProperty("parallax-position-start",-.5+.5*n),r.setProperty("parallax-position-end",.5+.5*(1-n));let a=this.data.viewport.windowHeight;r.setProperty("offset-top",s*a),r.setProperty("offset-bottom",s*a)}onScroll(t){super.onScroll(t),this.scrollHandler()}onResize(){let t=window.innerWidth>1080;this.scrollHandler=t?this.handleScrollDesktop:this.handleScrollMobile,t||this.handleScrollDesktop()}};var yt=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 St=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,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 Mt=class extends g{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=`
|
1
|
+
"use strict";var Ht=Object.defineProperty;var Kt=Object.getOwnPropertyDescriptor;var Qt=Object.getOwnPropertyNames;var Gt=Object.prototype.hasOwnProperty;var Jt=(l,e)=>{for(var t in e)Ht(l,t,{get:e[t],enumerable:!0})},Zt=(l,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Qt(e))!Gt.call(l,i)&&i!==t&&Ht(l,i,{get:()=>e[i],enumerable:!(r=Kt(e,i))||r.enumerable});return l};var te=l=>Zt(Ht({},"__esModule",{value:!0}),l);var ae={};Jt(ae,{StringAnchor:()=>gt,StringCursor:()=>ct,StringData:()=>R,StringDelayLerpTracker:()=>Ct,StringFPSTracker:()=>wt,StringGlide:()=>ft,StringLazy:()=>dt,StringLerp:()=>bt,StringLerpTracker:()=>Tt,StringLoading:()=>ut,StringMagnetic:()=>pt,StringModule:()=>g,StringObject:()=>O,StringParallax:()=>vt,StringPositionTracker:()=>Lt,StringProgress:()=>k,StringResponsive:()=>ht,StringScrollbar:()=>Mt,StringSequence:()=>Ot,StringSplit:()=>Et,StringTune:()=>Nt,StringVideoAutoplay:()=>It,default:()=>Nt});module.exports=te(ae);var K=class{constructor(e=.1,t){this.SETTLE_THRESHOLD=.1;this.smoothingFactor=e,this.context=t,this.onSettingsChange()}onMouseMove(e){this.context.data.cursor.targetX=e.clientX,this.context.data.cursor.targetY=e.clientY}onFrame(){let{targetX:e,targetY:t,smoothedX:r,smoothedY:i}=this.context.data.cursor,o=this.context.tools.lerp.process({from:r,to:e,progress:this.smoothingFactor}),n=this.context.tools.lerp.process({from:i,to:t,progress:this.smoothingFactor}),s=this.getStepDistance(o,n);this.isSettled(s)?this.snapToTarget():this.applyStep(o,n)}onSettingsChange(){let e=Number(this.context.settings.lerp);this.setLerpFactor(e)}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 I=class{constructor(){this.listeners={}}on(e,t,r){let i=r?`${e}:${r}`:e;this.listeners[i]||(this.listeners[i]=new Set),this.listeners[i].add(t)}off(e,t,r){let i=r?`${e}_${r}`:e;this.listeners[i]&&this.listeners[i].delete(t)}emit(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={}}};var Q=class{constructor(e){this.data=e;this.modules=[];this.uiModules=[]}register(e){e.type===1&&this.modules.push(e),e.type===2&&this.uiModules.push(e)}find(e){return this.modules.find(t=>t instanceof e)}onInit(){[...this.modules,...this.uiModules].forEach(e=>e.onInit())}onFrame(){[...this.modules,...this.uiModules].forEach(e=>e.onFrame(this.data))}onScroll(){[...this.modules,...this.uiModules].forEach(e=>e.onScroll(this.data))}onResize(){[...this.modules,...this.uiModules].forEach(e=>e.onResize())}onMouseMove(e){[...this.modules,...this.uiModules].forEach(t=>t.onMouseMove(e))}onWheel(e){[...this.modules,...this.uiModules].forEach(t=>t.onWheel(e))}onDirectionChange(){[...this.modules,...this.uiModules].forEach(e=>e.onDirectionChange())}onScrollStart(){[...this.modules,...this.uiModules].forEach(e=>e.onScrollStart())}onScrollStop(){[...this.modules,...this.uiModules].forEach(e=>e.onScrollStop())}onAxisChange(){[...this.modules,...this.uiModules].forEach(e=>e.onAxisChange())}onDeviceChange(){[...this.modules,...this.uiModules].forEach(e=>e.onDeviceChange())}onScrollConfigChange(){[...this.modules,...this.uiModules].forEach(e=>e.onScrollConfigChange())}onSettingsChange(){[...this.modules,...this.uiModules].forEach(e=>e.onSettingsChange())}onDOMMutate(e,t){[...this.modules,...this.uiModules].forEach(r=>r.onDOMMutate(e,t))}destroy(){[...this.modules,...this.uiModules].forEach(e=>e.destroy()),this.modules=[],this.uiModules=[]}get all(){return[...this.modules,...this.uiModules]}get core(){return this.modules}get ui(){return this.uiModules}};var O=class{constructor(e,t){this.id="";this.keys=[];this.connects=[];this.properties=new Map;this.modules=[];this.events=new I;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)}};var G=class{constructor(e,t,r){this.data=e;this.modules=t;this.events=r;this.objects=new Map;this.connectQueue=[];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 O(t,e);e.setAttribute(r,i.id);let o=e.getAttribute("string")??e.getAttribute("data-string");o&&(i.keys=(o??"").split("|")),e.setAttribute("string-inited",""),this.objects.set(i.id,i);let n=this.getAllAttributes(e);this.modules.core.forEach(a=>{"setupCoreProperties"in a&&typeof a.setupCoreProperties=="function"&&a.setupCoreProperties(i,e,n)}),this.modules.core.forEach(a=>{a.canConnect(i)&&(a.initializeObject(this.globalId,i,e,n),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,e)}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(),this.objects.delete(e))}enqueueConnection(e,t){this.connectQueue.push({id:e,element:t})}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 o=s=>{s.forEach(a=>{this.events.emit(`object:activate:${e.id}`,a.isIntersecting),a.isIntersecting?e.enter():e.leave()})},n=new IntersectionObserver(o,{root:null,rootMargin:`${i+this.data.viewport.windowHeight}px 0px ${r+this.data.viewport.windowHeight}px 0px`,threshold:0});n.observe(t),e.setProperty("observer-progress",n)}observeDOM(){new MutationObserver(t=>{t.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(n=>{this.isFixed(n)||this.handleRemoved(n)}))}),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(s=>this.add(s));let n=o.getAttribute("string-copy-from")??o.getAttribute("data-string-copy-from");n&&(this.objects.has(n)?this.objects.get(n).connects.push(o):this.enqueueConnection(n,o))}),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(){this.objects.forEach(e=>{this.modules.core.forEach(t=>{if(t.canConnect(e)){let r=this.getAllAttributes(e.htmlElement);t.initializeObject(this.globalId,e,e.htmlElement,r),t.calculatePositions(e,this.data.viewport.windowHeight),t.connectObject(e)}})})}isFixed(e){return e.hasAttribute("string-fixed")}checkInview(){this.objects.forEach(e=>{let t=this.data.scroll.transformedCurrent,r=e.getProperty("inview-start-position"),i=e.getProperty("inview-end-position"),o=e.getProperty("is-inview")??!1,n=t>=r&&t<=i;n!==o&&(e.setProperty("is-inview",n),this.events.emit(`object:inview:${e.id}`,n),n?e.show():e.hide())})}};var C=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)}};var J=class extends C{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}}};var Z=class extends C{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 T={SCROLL_FORWARD:"-scroll-forward",SCROLL_BACKWARD:"-scroll-backward",SCROLLING_FORWARD:"-scrolling-forward",SCROLLING_BACKWARD:"-scrolling-backward"};var tt=class extends C{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(),document.documentElement.classList.toggle(T.SCROLLING_FORWARD,t),document.documentElement.classList.toggle(T.SCROLLING_BACKWARD,!t),document.documentElement.classList.toggle(T.SCROLL_FORWARD,t),document.documentElement.classList.toggle(T.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(T.SCROLLING_BACKWARD,T.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,o=this.context.data.scroll.target===this.context.data.scroll.bottomPosition&&r>0;i||o||(this.context.data.scroll.delta+=this.wheelImpulse)}onScroll(t){this.isProg||(this.isScrollbarManipulation=!0)}};var et=class{constructor(e){this.context=e;this.modes=new Map;this.modes.set("smooth",new tt(e)),this.modes.set("default",new J(e)),this.modes.set("disable",new Z(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 rt=class{constructor(){this.targetX=0;this.targetY=0;this.smoothedX=0;this.smoothedY=0;this.stepX=0;this.stepY=0}};var it=class{constructor(){this.threeInstance=null}};var ot=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 nt=class{constructor(){this.now=0;this.previous=0;this.delta=0;this.elapsed=0}};var st=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 R=class{constructor(){this.scroll=new ot;this.viewport=new st;this.cursor=new rt;this.render=new it;this.time=new nt}};var g=class{constructor(e){this.objectMapOnPage=new Map;this.objectsOnPage=[];this.objectMap=new Map;this.objects=[];this.htmlKey="";this._type=1;this.tools=e.tools,this.data=e.data,this.settings=e.settings,this.events=e.events,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:(t,r,i)=>{let o=i.top;return Math.floor(o)+this.data.scroll.container.scrollTop*this.data.viewport.transformScale}},{key:"end",type:"number",fallback:(t,r,i)=>{let o=i.top,n=i.height;return o+n-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 o=this.tools.boundingClientRect.process({element:r});for(let{key:n,type:s,fallback:a,transform:u}of this.attributesToMap){let p=typeof a=="function"?a(r,t,o):a,c=this.tools.domAttribute.process({element:r,key:n,fallback:i[n]??this.settings[n]??p}),d=this.parseAttribute(c,s,{element:r,viewportHeight:this.data.viewport.windowHeight,baseRem:this.data.viewport.baseRem});u&&(d=u(d)),t.setProperty(n,d)}}calculatePositions(e,t){let r=e.getProperty("start"),i=e.getProperty("size"),o=e.getProperty("offset-bottom"),n=e.getProperty("offset-top"),s=e.getProperty("enter-el"),a=e.getProperty("enter-vp"),u=e.getProperty("exit-el"),p=e.getProperty("exit-vp"),c=0,d=0,m=0,f=0;s==="top"&&a==="top"||s==="left"&&a==="left"?(m=-t+1,c=r-o):s==="top"&&a==="bottom"||s==="left"&&a==="right"?c=r-t-o:s==="bottom"&&a==="top"||s==="right"&&a==="left"?(m=-t-i+1,c=r+i-o):(s==="bottom"&&a==="bottom"||s==="right"&&a==="right")&&(m=-i+1,c=r-t+i-o),u==="top"&&p==="top"||u==="left"&&p==="left"?(f=-i+1,d=r+n):u==="top"&&p==="bottom"||u==="left"&&p==="right"?(f=-t-i+1,d=r-t+n):u==="bottom"&&p==="top"||u==="right"&&p==="left"?d=r+i+n:(u==="bottom"&&p==="bottom"||u==="right"&&p==="right")&&(f=-t+1,d=r-t+i+n),e.setProperty("start-bias",m),e.setProperty("end-bias",f),e.setProperty("start-position",c-this.data.scroll.topPosition),e.setProperty("end-position",d),e.setProperty("difference-position",d-c);let h=e.getProperty("inview-top")??0,y=e.getProperty("inview-bottom")??0;e.setProperty("inview-start-position",c-this.data.scroll.topPosition+m+h),e.setProperty("inview-end-position",d+f+y)}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?this.tools.unitParser.process({value:e,element:r.element,viewportHeight:r.viewportHeight,baseRem:r.baseRem}):0;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)}onObjectConnected(e){}applyToElementAndConnects(e,t){t(e.htmlElement),e.connects.forEach(t)}destroy(){this.objects=[],this.objectMap=new Map}onInit(){}onFrame(e){}onResize(){}onScroll(e){}onDirectionChange(){}onScrollStart(){}onScrollStop(){}onScrollDirectionChange(){}onAxisChange(){}onDeviceChange(){}onScrollConfigChange(){}onSettingsChange(){}onDOMRebuild(){}onMouseMove(e){}onWheel(e){}onDOMMutate(e,t){}};var A=class{process({element:e}){return e.getBoundingClientRect()}};var H=class{process({element:e,key:t,fallback:r=null}){return e.getAttribute(`string-${t}`)??e.getAttribute(`data-string-${t}`)??r}};var F=class{process({record:e,name:t,fallback:r=null}){return e[t]??e[`data-${t}`]??r}};var L=class{process({element:e}){let t=e.getBoundingClientRect(),i=getComputedStyle(e).transform.match(/-?[\d.]+/g)?.map(parseFloat)??[];if(i.length===6){let[o,n,s,a,u,p]=i,c=o*a-n*s;return{width:t.width/(o||1),height:t.height/(a||1),left:(t.left*a-t.top*s+s*p-u*a)/c,top:(-t.left*n+t.top*o+u*n-o*p)/c}}return t}};var V=class{constructor(e=new L){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 N=class{process({from:e,to:t,progress:r}){return(t-e)*r}};var W=class{process({value:e,element:t,viewportHeight:r,baseRem:i}){let o=e.startsWith("-");o&&(e=e.slice(1));let n=0;return e==="selfHeight"?n=t.offsetHeight:e.endsWith("px")?n=parseFloat(e):e.endsWith("%")?n=parseFloat(e)/100*r:e.endsWith("rem")&&(n=parseFloat(e)*i),o?-n:n}};var B=class{process({value:e,inMin:t=.1,inMax:r=1,outMin:i=.05,outMax:o=.65}){if(e<t)return o;if(e>1&&(e=1),e<=r){let n=(e-t)/(r-t);return o-n*(o-i)}return i}};var q=class{process({value:e}){let t=e.trim();if(t.startsWith("random(")&&t.endsWith(")")){let r=t.slice(7,-1).split(",").map(o=>o.trim()).filter(Boolean),i=Math.floor(Math.random()*r.length);return r[i]}return t}};var z=class{process({value:e}){let t=e.trim().toLowerCase();if(t.startsWith("#")){let o=t.slice(1);o.length===3&&(o=o.split("").map(p=>p+p).join(""));let n=parseInt(o.slice(0,2),16),s=parseInt(o.slice(2,4),16),a=parseInt(o.slice(4,6),16),u=o.length===8?parseInt(o.slice(6,8),16)/255:1;return{r:n,g:s,b:a,a:u}}let r=t.match(/rgba?\(([^)]+)\)/);if(r){let[o,n,s,a=1]=r[1].split(",").map(u=>parseFloat(u.trim()));return{r:o,g:n,b:s,a}}let i=t.match(/hsla?\(([^)]+)\)/);if(i){let[o,n,s,a="1"]=i[1].split(",").map(d=>d.trim()),[u,p,c]=this.hslToRgb(parseFloat(o),parseFloat(n),parseFloat(s));return{r:u,g:p,b:c,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=(p,c,d)=>(d<0&&(d+=1),d>1&&(d-=1),d<1/6?p+(c-p)*6*d:d<1/2?c:d<2/3?p+(c-p)*(2/3-d)*6:p),o=r<.5?r*(1+t):r+t-r*t,n=2*r-o,s=Math.round(i(n,o,e+1/3)*255),a=Math.round(i(n,o,e)*255),u=Math.round(i(n,o,e-1/3)*255);return[s,a,u]}};var $=class{process({value:e,rules:t,messages:r={}}){for(let i of t){let o=null;if(i==="required"&&e.trim()===""?o="required":i==="email"&&!/^\S+@\S+\.\S+$/.test(e)?o="invalid-email":typeof i=="object"&&(i.type==="minLength"&&e.length<i.value&&(o="too-short"),i.type==="maxLength"&&e.length>i.value&&(o="too-long")),o){let n=r[o],s=typeof n=="function"?n({value:e,rule:i}):n??this.defaultMessage(o,i);return{valid:!1,error:o,message:s}}}return{valid:!0,error:null,message:null}}defaultMessage(e,t){switch(e){case"required":return"This field is required.";case"invalid-email":return"Please enter a valid email.";case"too-short":return`Too short${typeof t=="object"&&"value"in t?` (min ${t.value})`:""}.`;case"too-long":return`Too long${typeof t=="object"&&"value"in t?` (max ${t.value})`:""}.`}}};var _=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,o,n,s]=r.slice(1).map(Number);return this.cubicBezier(i,o,n,s)}return i=>i}cubicBezier(e,t,r,i){let o=3*e,n=3*(r-e)-o,s=1-o-n,a=3*t,u=3*(i-t)-a,p=1-a-u;function c(h){return((s*h+n)*h+o)*h}function d(h){return((p*h+u)*h+a)*h}function m(h){return(3*s*h+2*n)*h+o}function f(h,y=1e-5){let S,M,b=h,v,x,w;for(w=0;w<8;w++){if(v=c(b)-h,Math.abs(v)<y)return b;if(x=m(b),Math.abs(x)<1e-6)break;b=b-v/x}for(S=0,M=1,b=h;S<M;){if(v=c(b)-h,Math.abs(v)<y)return b;v>0?M=b:S=b,b=(M+S)/2}return b}return function(h){return d(f(h))}}};var Y=class{process({distance:e,radius:t,strength:r}){if(e>=t)return 0;let i=(t-e)/t;return r*i}};var U=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 X=class{process({from:e,to:t,progress:r}){return{x:(t.x-e.x)*r,y:(t.y-e.y)*r}}};var j=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 o=i[1].split(",").map(n=>parseFloat(n.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(n=>parseFloat(n.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(n=>parseFloat(n.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(n=>parseFloat(n.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 at=class{process({attributeValue:e}){let t={line:[],word:[],char:[],charLine:[],charWord:[],wordLine:[]};return e&&e.split("|").forEach(i=>{let o=i.trim();if(!o)return;let n=o.match(/^(\w+-)?(\w+)(\[(.*?)\])?$/);if(n){let s=n[1]||"",a=n[2],u=s+a,c=(n[4]||"").split(";").map(m=>m.trim()).filter(m=>m.length>0),d=this.parseParamsArray(c);switch(u){case"line":t.line.push(d);break;case"word":t.word.push(d);break;case"char":t.char.push(d);break;case"charLine":t.charLine.push(d);break;case"charWord":t.charWord.push(d);break;case"wordLine":t.wordLine.push(d);break;default:console.warn(`SplitOptionsParserTool: Unrecognized option type "${u}" in part "${o}"`);break}}else console.warn(`SplitOptionsParserTool: Could not parse part format "${o}"`)}),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 lt=class{constructor(){this.domAttribute=new H;this.recordAttribute=new F;this.transformNullify=new L;this.boundingClientRect=new A;this.relativePosition=new V(this.transformNullify);this.unitParser=new W;this.lerp=new N;this.adaptiveLerp=new B;this.originParser=new q;this.colorParser=new z;this.validation=new $;this.easingFunction=new _;this.magneticPull=new Y;this.lerpColor=new U;this.lerpVector=new X;this.transformScaleParser=new j;this.optionsParser=new at}};var ct=class extends g{constructor(t){super(t);this.enterObjectsMap=new Map;this.enterObjects=new Array;this.overCount=0;this.htmlKey="cursor",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,o){super.initializeObject(t,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(t){requestAnimationFrame(()=>{this.objects.forEach(s=>{let a=s.getProperty("is-mouse-over"),u=s.getProperty("cursor-target-disable"),p=s.getProperty("lerp")??.15;if(a&&!u){let c=s.htmlElement.getBoundingClientRect(),d=this.data.cursor.targetX,m=this.data.cursor.targetY,f=d-c.left,h=m-c.top,y=s.getProperty("mouse-pixel-x")??0,S=s.getProperty("mouse-pixel-y")??0,M=y-f,b=S-h;if(M*M+b*b>1e-4){(s.getProperty("is-mouse-move")??!1)||(s.setProperty("is-mouse-move",!0),s.setProperty("mouse-pixel-x",f),s.setProperty("mouse-pixel-y",h),s.setProperty("mouse-x",f),s.setProperty("mouse-y",h),y=f,S=h,this.events.emit(`cursor:start:${s.id}`,null));let w=this.tools.lerp.process({from:y,to:f,progress:p}),jt=this.tools.lerp.process({from:S,to:h,progress:p}),Dt=y+w,kt=S+jt;s.setProperty("mouse-pixel-x",Dt),s.setProperty("mouse-pixel-y",kt);let Wt=s.getProperty("alignment")??"center",Rt=this.calculateOffset(Wt,Dt,c.width),At=this.calculateOffset(Wt,kt,c.height);s.setProperty("mouse-x",Rt),s.setProperty("mouse-y",At),this.setMouseCoordinates(s,Rt,At),this.events.emit(`cursor:move:${s.id}`,{x:Rt,y:At}),this.events.emit(`cursor:pixel:${s.id}`,{x:Dt,y:kt})}else s.setProperty("mouse-pixel-x",f),s.setProperty("mouse-pixel-y",h),this.events.emit(`cursor:end:${s.id}`,null)}else{let c=s.getProperty("mouse-x")??0,d=s.getProperty("mouse-y")??0;if(c!==0||d!==0){s.setProperty("is-mouse-move",!1);let m=s.htmlElement.getBoundingClientRect(),f=s.getProperty("half-width")??m.width/2,h=s.getProperty("half-height")??m.height/2,y=this.calculateOffset("center",f,m.width),S=this.calculateOffset("center",h,m.height),M=c+this.tools.lerp.process({from:c,to:y,progress:p}),b=d+this.tools.lerp.process({from:d,to:S,progress:p});s.setProperty("mouse-x",M),s.setProperty("mouse-y",b),Math.abs(M)<.001&&Math.abs(b)<.001&&(s.setProperty("mouse-x",0),s.setProperty("mouse-y",0),s.setProperty("mouse-pixel-x",0),s.setProperty("mouse-pixel-y",0)),this.setMouseCoordinates(s,M,b)}}});let{stepX:r,stepY:i,smoothedX:o,smoothedY:n}=this.data.cursor;(r!==0||i!==0)&&(this.events.emit("cursor",{stepX:r,stepY:i,x:o,y:n}),this.cursor.style.setProperty("--x",o.toString()),this.cursor.style.setProperty("--y",n.toString()),this.cursor.style.setProperty("--x-lerp",r.toString()),this.cursor.style.setProperty("--y-lerp",i.toString()))})}onObjectConnected(t){let r=t.htmlElement;t.setProperty("timeoutId",null),t.setProperty("mouseleave",()=>{this.onMouseLeave(t)}),t.setProperty("mouseenter",()=>{this.onMouseEnter(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"))}getCursorClass(t){let r=t.getProperty("cursor-class");return r!=null&&r.length>0?r:null}onMouseEnter(t){this.overCount++,t.setProperty("is-mouse-over",!0);let r=this.getCursorClass(t);r&&this.cursor.classList.add(r),this.cursor.classList.add("-showing"),t.setProperty("timeoutId",setTimeout(()=>{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);r&&this.cursor.classList.remove(r),this.cursor.classList.remove("-showing"),this.cursor.classList.remove("-show"),t.htmlElement.removeEventListener("mouseleave",t.getProperty("mouseleave"))}onEnterObject(t){t.htmlElement.addEventListener("mouseenter",t.getProperty("mouseenter"))}onLeaveObject(t){t.htmlElement.removeEventListener("mouseenter",t.getProperty("mouseenter")),t.htmlElement.removeEventListener("mouseleave",t.getProperty("mouseleave"))}setMouseCoordinates(t,r,i){t.getProperty("cursor-target-style-disable")||this.applyToElementAndConnects(t,o=>{o.style.setProperty("--x",r.toFixed(2)),o.style.setProperty("--y",i.toFixed(2))})}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 pt=class extends g{constructor(e){super(e),this.htmlKey="magnetic",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(),o=i.left+(t.getProperty("half-width")??0),n=i.top+(t.getProperty("half-height")??0),s=e.clientX-o,a=e.clientY-n,u=Math.sqrt(s**2+a**2),p=t.getProperty("radius")??0,c=t.getProperty("strength")??0,d=this.tools.magneticPull.process({distance:u,radius:p,strength:c});t.setProperty("magnetic-target-x",s*d),t.setProperty("magnetic-target-y",a*d),d>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,o=t.getProperty("lerp")??0,n=t.getProperty("magnetic-target-x")??0,s=t.getProperty("magnetic-target-y")??0,a=this.tools.lerp.process({from:r,to:n,progress:o}),u=this.tools.lerp.process({from:i,to:s,progress:o});a>-.01&&a<.01&&(a=0,t.setProperty("magnetic-x",t.getProperty("magnetic-target-x"))),u>-.01&&u<.01&&(u=0,t.setProperty("magnetic-y",t.getProperty("magnetic-target-y"))),r+=a,i+=u,t.setProperty("magnetic-x",r),t.setProperty("magnetic-y",i),this.events.emit(`magnetic:move:${t.id}`,{x:r,y:i}),this.applyToElementAndConnects(t,p=>{p.style.setProperty("--magnetic-x",r.toString()),p.style.setProperty("--magnetic-y",i.toString())}),(t.getProperty("magnetic-target-x")==r||t.getProperty("magnetic-target-y")==i)&&t.setProperty("is-magneting",!1)}})}};var dt=class extends g{constructor(t){super(t);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(t){if(this.loadingCount++,this.isStartLoaded){let r=t.htmlElement;this.loadImage(r)}}async loadImage(t){let r=this.tools.domAttribute.process({element:t,key:this.htmlKey,fallback:""});if(r)try{t.classList.add("lazyLoad"),t.src=r,t.addEventListener("load",()=>{t.classList.add("-loaded")}),await this.setAspectRatio(t,r)}catch{console.warn("Failed to load image:",r)}}setAspectRatio(t,r){return new Promise((i,o)=>{let n=new XMLHttpRequest;n.open("GET",r,!0),n.responseType="arraybuffer",n.setRequestHeader("Range","bytes=0-"),n.onload=()=>{if(n.status===200||n.status===206){let s=new Blob([n.response]),a=new Image;a.onload=()=>{t.style.aspectRatio=`${a.width} / ${a.height}`,URL.revokeObjectURL(a.src),this.loadingCount--,this.loadingCount<=0&&(this.events.emit("image:load:all",null),this.loadingCount=0),i()},a.onerror=()=>{URL.revokeObjectURL(a.src),this.loadingCount--,o(new Error("Image failed to decode"))},a.src=URL.createObjectURL(s)}else o(new Error("Image request failed"))},n.onerror=()=>o(new Error("XHR error")),n.send()})}};var ut=class extends g{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 mt=class extends g{constructor(e){super(e),this.htmlKey=""}canConnect(e){return e.keys[0]==null}};var D=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}},ht=class extends g{constructor(t){super(t);this.queries={0:new D({max:359}),1:new D({min:360,max:1079}),2:new D({min:1080,max:1365}),3:new D({min:1366})};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.mobile.min==null?null:t.mobile.min,t.mobile.max??null),this.matchMedias[1]=window.matchMedia(this.queries[0].mediaQuery)):this.queries[1].enable=!1,t.laptop?(this.queries[2].enable=!0,this.queries[2].setRange(t.mobile.min==null?null:t.mobile.min,t.mobile.max??null),this.matchMedias[2]=window.matchMedia(this.queries[0].mediaQuery)):this.queries[2].enable=!1,t.desktop?(this.queries[3].enable=!0,this.queries[3].setRange(t.mobile.min==null?null:t.mobile.min,t.mobile.max??null),this.matchMedias[3]=window.matchMedia(this.queries[0].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,o=this.matchMedias[3].matches&&this.queries[3].enable;document.querySelectorAll("[string-mobile], [string-tablet], [string-laptop], [string-desktop]").forEach(s=>{let a=!1;s.hasAttribute("string-mobile")&&t&&(a=!0,this.events.emit("screen:mobile",t)),s.hasAttribute("string-tablet")&&r&&(a=!0,this.events.emit("screen:tablet",r)),s.hasAttribute("string-laptop")&&i&&(a=!0,this.events.emit("screen:laptop",i)),s.hasAttribute("string-desktop")&&o&&(a=!0,this.events.emit("screen:desktop",o)),a?s.style.display=null:s.style.display="none"})}};var gt=class extends g{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,o=this.tools.originParser.process({value:r}),n=this.tools.originParser.process({value:i});return{x:o,y:n}}}]}onObjectConnected(e){super.onObjectConnected(e);let t=e.getProperty("anchor");t&&this.applyToElementAndConnects(e,r=>{r.style.transformOrigin=`${t.x} ${t.y}`})}};var ee=.05,re=.01,Bt=1,ie=-1,oe=1,ft=class extends g{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 o=`translate3d(0, ${i}px, 0)`;t.htmlElement.style.transform=o};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(Bt,this.acceleration+ee),this.displacement=Math.max(re,Math.min(Bt,this.displacement+this.velocityMultiplier)),this.data.scroll.displacement=Math.min(oe,Math.max(ie,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 bt=class extends g{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 k=class extends g{constructor(e){super(e),this.htmlKey="progress",this.attributesToMap=[...this.attributesToMap,{key:"easing",type:"easing",fallback:this.settings.easing}]}initializeObject(e,t,r,i){super.initializeObject(e,t,r,i)}onScroll(e){super.onScroll(e),this.objects.forEach(t=>{this.setUpObject(t)})}onObjectConnected(e){super.onObjectConnected(e),e.setProperty("setUpObject",this.setUpObject.bind(this)),e.events.on("enter",e.getProperty("setUpObject"))}setUpObject(e){let t=e.getProperty("start-position"),r=e.getProperty("difference-position"),i=e.getProperty("key"),o=e.getProperty("easing")(Math.min(1,Math.max(0,(this.data.scroll.transformedCurrent-t)/r)));if(e.getProperty("progress")!==o){this.events.emit(`object:progress:${e.id}`,o),e.setProperty("progress",o);let n=o.toString();this.applyToElementAndConnects(e,s=>{s.style.setProperty(i,n)})}}};var vt=class extends k{constructor(t){super(t);this.handleScrollDesktop=()=>{this.objects.forEach(t=>{let r=t.getProperty("progress")??0,i=t.getProperty("parallax")??0,o=t.getProperty("parallax-position-start")??0,n=t.getProperty("parallax-position-end")??1,s=t.getProperty("parallax-sign")??1,a=this.data.viewport.windowHeight,u=s*i*(a*o+r*a*n);this.events.emit(`object:parallax:${t.id}`,u);let p=`translate3d(0, ${u}px, 0)`;this.applyToElementAndConnects(t,c=>{c.style.transform=p})})};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(t,r,i,o){super.initializeObject(t,r,i,o);let n=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*n),r.setProperty("parallax-position-end",.5+.5*(1-n));let a=this.data.viewport.windowHeight;r.setProperty("offset-top",s*a),r.setProperty("offset-bottom",s*a)}onScroll(t){super.onScroll(t),this.scrollHandler()}onResize(){let t=window.innerWidth>1080;this.scrollHandler=t?this.handleScrollDesktop:this.handleScrollMobile,t||this.handleScrollDesktop()}};var yt=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 St=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,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 Mt=class extends g{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(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 yt(this.data,this.scrollbar,this.thumb),this.scrollbarStateVertical=new St(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 P={BEFORE_ELEMENT:"-before-element",AFTER_ELEMENT:"-after-element"};function Wt(l,e){let t=document.createDocumentFragment(),r=0,i=E(e,"line")||E(e,"charLine")||E(e,"wordLine");return l.forEach(o=>{let n=t;i&&(n=document.createElement("span"),n.classList.add("-s-line"),o.isBeforeElement&&n.classList.add(P.BEFORE_ELEMENT),o.isAfterElement&&n.classList.add(P.AFTER_ELEMENT),n.style.setProperty("--line-index",String(o.lineIndex)),n.style.setProperty("--word-total",String(o.words.length)),Ht(n,o.calculatedValues,e)),o.words.forEach((s,a)=>{let u=a===o.words.length-1;if(s.chars.length===1&&s.chars[0].token.type==="element"){let m=s.chars[0].token.node.cloneNode(!0);n.appendChild(m),u||n.appendChild(document.createTextNode("\xA0"));return}let d=E(e,"word")||E(e,"charWord")||E(e,"wordLine"),c=d?document.createElement("span"):n;if(d&&(c.classList.add("-s-word"),s.isBeforeElement&&c.classList.add(P.BEFORE_ELEMENT),s.isAfterElement&&c.classList.add(P.AFTER_ELEMENT),c.style.setProperty("--word-index",String(s.wordIndexGlobal)),c.style.setProperty("--char-total",String(s.chars.length)),Ht(c,s.calculatedValues,e)),E(e,"char")||E(e,"charLine")||E(e,"charWord"))s.chars.forEach(m=>{if(m.char===" "||m.char===" ")return;let f=document.createElement("span"),h=f;h.classList.add("-s-char"),m.isBeforeElement&&h.classList.add(P.BEFORE_ELEMENT),m.isAfterElement&&h.classList.add(P.AFTER_ELEMENT),h.textContent=m.char,h.style.setProperty("--char-index",String(r++)),Ht(h,m.calculatedValues,e),c.appendChild(f)});else{let m=document.createTextNode(s.chars.map(f=>f.char).join(""));c.appendChild(m)}d&&n.appendChild(c),u?n.appendChild(document.createElement("br")):c.appendChild(document.createTextNode("\xA0"))}),i&&t.appendChild(n)}),t}function Ht(l,e,t){if(e)for(let r of e){if(!ie(r.type,r.align,t))continue;let i=oe(r.type,r.align);l.style.setProperty(i,String(r.value))}}function ie(l,e,t){let r=t[l]??[];return Array.isArray(r)&&r.some(i=>e.startsWith("random")?i.align.startsWith("random"):i.align===e)}function oe(l,e){let t=e.startsWith("random")?"random":e;return`--${l}-${t}`}function E(l,e){return Array.isArray(l[e])&&l[e].length>0}var xt=0;function Bt(l){xt=0;let e=[];return l.forEach(t=>{if(t.nodeType===Node.ELEMENT_NODE){let r=t;e.push({type:"element",id:`el_${xt++}`,node:r,tagName:r.tagName.toLowerCase()})}else if(t.nodeType===Node.TEXT_NODE){let r=t.nodeValue??"",i=`text_${xt++}`;r.trim()?e.push({type:"text",id:i,node:t,content:r}):e.push({type:"space",id:i,node:t,content:r})}else e.push({type:"other",id:`node_${xt++}`,node:t})}),e}function zt(l,e){let t=document.createElement("div"),r=window.getComputedStyle(e);t.style.position="absolute",t.style.visibility="hidden",t.style.pointerEvents="none",t.style.width=e.clientWidth+"px",t.style.padding=r.padding,t.style.font=r.font,t.style.letterSpacing=r.letterSpacing,t.style.lineHeight=r.lineHeight,t.style.fontVariant=r.fontVariant,t.style.fontStretch=r.fontStretch,e.appendChild(t);let i=[],o=!1;var n,s;return l.forEach((a,u)=>{let d;switch(a.type){case"text":a.content.trim().split(/\s+/).filter(m=>m.length>0).forEach((m,f)=>{d=document.createTextNode(m),n=document.createElement("span"),n.style.display="inline-block",n.appendChild(d),n.appendChild(document.createTextNode("\xA0")),t.appendChild(n),s=n.getBoundingClientRect();let h={token:{type:"text",id:"",node:d,content:m},rect:s};o&&(o=!1,h.token.meta={...h.token.meta||{},isAfterElement:!0}),i.push(h)});break;case"element":d=a.node.cloneNode(!0),n=document.createElement("span"),n.style.display="inline-block",n.appendChild(d),t.appendChild(n),s=n.getBoundingClientRect(),i.push({token:a,rect:s});let p=i[i.length-2];p?.token.type==="text"&&(p.token.meta={...p.token.meta||{},isBeforeElement:!0}),o=!0;break;case"other":return}}),e.removeChild(t),i}var qt=1;function _t(l){let e=[],t=null,r=0,i=0,o=0;return l.forEach(n=>{let s=n.token,a=s.meta?.isBeforeElement??!1,u=s.meta?.isAfterElement??!1;if(s.type==="text"){let d=s.content.match(/(\s+|\S+)/g);if(!d)return;let c=n.rect.left,p=s.content.length,m=p>0?n.rect.width/p:0;d.forEach(f=>{if(/^\s+$/.test(f)){c+=m*f.length;return}let h=[];if(f.split("").forEach((v,x)=>{let T=new DOMRect(c,n.rect.top,m,n.rect.height);h.push({char:v,rect:T,token:s,charIndexInWord:x,charIndexInLine:0,charIndexGlobal:i++}),c+=m}),h.length>0){let v=h[h.length-1];a&&(v.isBeforeElement=!0),u&&(v.isAfterElement=!0)}if((!t||Math.abs(n.rect.top-r)>qt)&&(r=n.rect.top,t={words:[],rect:n.rect,lineIndex:e.length},e.push(t)),!t)return;let y=t.words.length,M=t.words.reduce((v,x)=>v+x.chars.length,0);h.forEach((v,x)=>v.charIndexInLine=M+x);let b={chars:h,rect:n.rect,wordIndexGlobal:o++,wordIndexInLine:y,isBeforeElement:a,isAfterElement:u};t.words.push(b),t.rect=$t(t.words.map(v=>v.rect)),a&&(t.isBeforeElement=!0),u&&(t.isAfterElement=!0)})}else if(s.type==="element"){let d=n.rect;if((!t||Math.abs(d.top-r)>qt)&&(r=d.top,t={words:[],rect:d,lineIndex:e.length},e.push(t)),!t)return;let p=t.words.length,m=t.words.reduce((S,y)=>S+y.chars.length,0),h={chars:[{char:"[E]",rect:d,token:s,charIndexInWord:0,charIndexInLine:m,charIndexGlobal:i++}],rect:d,wordIndexGlobal:o++,wordIndexInLine:p,isBeforeElement:!1,isAfterElement:!1};t.words.push(h),t.rect=$t(t.words.map(S=>S.rect))}}),e}function $t(l){let e=Math.min(...l.map(o=>o.left)),t=Math.min(...l.map(o=>o.top)),r=Math.max(...l.map(o=>o.right)),i=Math.max(...l.map(o=>o.bottom));return new DOMRect(e,t,r-e,i-t)}var Et=class extends g{constructor(e){super(e),this.htmlKey="split"}onResize(){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 o=t.getAttribute("string-split")??"",n=this.tools.optionsParser.process({attributeValue:o}),{fragment:s,result:a}=this.split(t,n);e.setProperty("nodes",s.childNodes),t.innerHTML="",t.appendChild(a)}split(e,t){let r=document.createDocumentFragment();e.childNodes.forEach(a=>r.appendChild(a.cloneNode(!0)));let i=Bt(r.childNodes),o=zt(i,e),n=_t(o);this.applyCalculatedValues(n,t);let s=Wt(n,t);return{fragment:r,result:s}}computeValue(e,t,r){if(e.align.startsWith("random")){let i=e.random?.min??0,o=e.random?.max??r-1;return Math.floor(Math.random()*(o-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=n=>n.words.reduce((s,a)=>s+a.chars.length,0),i=e.reduce((n,s)=>n+s.words.length,0),o=e.reduce((n,s)=>n+s.words.reduce((a,u)=>a+u.chars.length,0),0);e.forEach((n,s)=>{t.line&&(n.calculatedValues=t.line.map(a=>({type:"line",align:a.align,value:this.computeValue(a,s,e.length)}))),n.words.forEach((a,u)=>{t.word&&(a.calculatedValues=t.word.map(c=>({type:"word",align:c.align,value:this.computeValue(c,a.wordIndexGlobal,i)}))),t.wordLine&&(a.calculatedValues??(a.calculatedValues=[]),a.calculatedValues.push(...t.wordLine.map(c=>({type:"wordLine",align:c.align,value:this.computeValue(c,a.wordIndexInLine,n.words.length)}))));let d=r(n);a.chars.forEach(c=>{let p=[];t.char&&p.push(...t.char.map(m=>({type:"char",align:m.align,value:this.computeValue(m,c.charIndexGlobal,o)}))),t.charWord&&p.push(...t.charWord.map(m=>({type:"charWord",align:m.align,value:this.computeValue(m,c.charIndexInWord,a.chars.length)}))),t.charLine&&p.push(...t.charLine.map(m=>({type:"charLine",align:m.align,value:this.computeValue(m,c.charIndexInLine,d)}))),c.calculatedValues=p})})})}escapeAttribute(e){return e.replace(/src="(https?:\/\/[^"\s]+)"/g,"src=$1")}};var Ct=class extends g{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((o,n)=>{let s=n,a=i-o*this.height;n===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 Tt=class extends g{constructor(t){super(t);this.frameCount=0;this._type=2}onInit(){this.createDisplayElement(),this.intervalId=window.setInterval(()=>{this.displayElement.textContent=`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 wt=class extends g{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((o,n)=>{let s=n,a=i-o/2;n===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 Lt=class extends g{constructor(e){super(e),this._type=2}onInit(){this.createDisplayElement()}onScroll(e){let t=e.scroll.current,r=e.scroll.target,i=t<r?"\u2193":t>r?"\u2191":"-";this.displayElement.setAttribute("data-dir",i),this.displayElement.setAttribute("data-val",`${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=`
|
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 yt(this.data,this.scrollbar,this.thumb),this.scrollbarStateVertical=new St(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 P={BEFORE_ELEMENT:"-before-element",AFTER_ELEMENT:"-after-element"};function qt(l,e){let t=document.createDocumentFragment(),r=0,i=E(e,"line")||E(e,"charLine")||E(e,"wordLine");return l.forEach(o=>{let n=t;i&&(n=document.createElement("span"),n.classList.add("-s-line"),o.isBeforeElement&&n.classList.add(P.BEFORE_ELEMENT),o.isAfterElement&&n.classList.add(P.AFTER_ELEMENT),n.style.setProperty("--line-index",String(o.lineIndex)),n.style.setProperty("--word-total",String(o.words.length)),Ft(n,o.calculatedValues,e)),o.words.forEach((s,a)=>{let u=a===o.words.length-1;if(s.chars.length===1&&s.chars[0].token.type==="element"){let m=s.chars[0].token.node.cloneNode(!0);n.appendChild(m),u||n.appendChild(document.createTextNode("\xA0"));return}let p=E(e,"word")||E(e,"charWord")||E(e,"wordLine"),c=p?document.createElement("span"):n;if(p&&(c.classList.add("-s-word"),s.isBeforeElement&&c.classList.add(P.BEFORE_ELEMENT),s.isAfterElement&&c.classList.add(P.AFTER_ELEMENT),c.style.setProperty("--word-index",String(s.wordIndexGlobal)),c.style.setProperty("--char-total",String(s.chars.length)),Ft(c,s.calculatedValues,e)),E(e,"char")||E(e,"charLine")||E(e,"charWord"))s.chars.forEach(m=>{if(m.char===" "||m.char===" ")return;let f=document.createElement("span"),h=f;h.classList.add("-s-char"),m.isBeforeElement&&h.classList.add(P.BEFORE_ELEMENT),m.isAfterElement&&h.classList.add(P.AFTER_ELEMENT),h.textContent=m.char,h.style.setProperty("--char-index",String(r++)),Ft(h,m.calculatedValues,e),c.appendChild(f)});else{let m=document.createTextNode(s.chars.map(f=>f.char).join(""));c.appendChild(m)}p&&n.appendChild(c),u?n.appendChild(document.createElement("br")):c.appendChild(document.createTextNode("\xA0"))}),i&&t.appendChild(n)}),t}function Ft(l,e,t){if(e)for(let r of e){if(!ne(r.type,r.align,t))continue;let i=se(r.type,r.align);l.style.setProperty(i,String(r.value))}}function ne(l,e,t){let r=t[l]??[];return Array.isArray(r)&&r.some(i=>e.startsWith("random")?i.align.startsWith("random"):i.align===e)}function se(l,e){let t=e.startsWith("random")?"random":e;return`--${l}-${t}`}function E(l,e){return Array.isArray(l[e])&&l[e].length>0}var xt=0;function zt(l){xt=0;let e=[];return l.forEach(t=>{if(t.nodeType===Node.ELEMENT_NODE){let r=t;e.push({type:"element",id:`el_${xt++}`,node:r,tagName:r.tagName.toLowerCase()})}else if(t.nodeType===Node.TEXT_NODE){let r=t.nodeValue??"",i=`text_${xt++}`;r.trim()?e.push({type:"text",id:i,node:t,content:r}):e.push({type:"space",id:i,node:t,content:r})}else e.push({type:"other",id:`node_${xt++}`,node:t})}),e}function $t(l,e){let t=document.createElement("div"),r=window.getComputedStyle(e);t.style.position="absolute",t.style.visibility="hidden",t.style.pointerEvents="none",t.style.width=e.clientWidth+"px",t.style.padding=r.padding,t.style.font=r.font,t.style.letterSpacing=r.letterSpacing,t.style.lineHeight=r.lineHeight,t.style.fontVariant=r.fontVariant,t.style.fontStretch=r.fontStretch,e.appendChild(t);let i=[],o=!1;var n,s;return l.forEach((a,u)=>{let p;switch(a.type){case"text":a.content.trim().split(/\s+/).filter(m=>m.length>0).forEach((m,f)=>{p=document.createTextNode(m),n=document.createElement("span"),n.style.display="inline-block",n.appendChild(p),n.appendChild(document.createTextNode("\xA0")),t.appendChild(n),s=n.getBoundingClientRect();let h={token:{type:"text",id:"",node:p,content:m},rect:s};o&&(o=!1,h.token.meta={...h.token.meta||{},isAfterElement:!0}),i.push(h)});break;case"element":p=a.node.cloneNode(!0),n=document.createElement("span"),n.style.display="inline-block",n.appendChild(p),t.appendChild(n),s=n.getBoundingClientRect(),i.push({token:a,rect:s});let d=i[i.length-2];d?.token.type==="text"&&(d.token.meta={...d.token.meta||{},isBeforeElement:!0}),o=!0;break;case"other":return}}),e.removeChild(t),i}var _t=1;function Ut(l){let e=[],t=null,r=0,i=0,o=0;return l.forEach(n=>{let s=n.token,a=s.meta?.isBeforeElement??!1,u=s.meta?.isAfterElement??!1;if(s.type==="text"){let p=s.content.match(/(\s+|\S+)/g);if(!p)return;let c=n.rect.left,d=s.content.length,m=d>0?n.rect.width/d:0;p.forEach(f=>{if(/^\s+$/.test(f)){c+=m*f.length;return}let h=[];if(f.split("").forEach((v,x)=>{let w=new DOMRect(c,n.rect.top,m,n.rect.height);h.push({char:v,rect:w,token:s,charIndexInWord:x,charIndexInLine:0,charIndexGlobal:i++}),c+=m}),h.length>0){let v=h[h.length-1];a&&(v.isBeforeElement=!0),u&&(v.isAfterElement=!0)}if((!t||Math.abs(n.rect.top-r)>_t)&&(r=n.rect.top,t={words:[],rect:n.rect,lineIndex:e.length},e.push(t)),!t)return;let S=t.words.length,M=t.words.reduce((v,x)=>v+x.chars.length,0);h.forEach((v,x)=>v.charIndexInLine=M+x);let b={chars:h,rect:n.rect,wordIndexGlobal:o++,wordIndexInLine:S,isBeforeElement:a,isAfterElement:u};t.words.push(b),t.rect=Yt(t.words.map(v=>v.rect)),a&&(t.isBeforeElement=!0),u&&(t.isAfterElement=!0)})}else if(s.type==="element"){let p=n.rect;if((!t||Math.abs(p.top-r)>_t)&&(r=p.top,t={words:[],rect:p,lineIndex:e.length},e.push(t)),!t)return;let d=t.words.length,m=t.words.reduce((y,S)=>y+S.chars.length,0),h={chars:[{char:"[E]",rect:p,token:s,charIndexInWord:0,charIndexInLine:m,charIndexGlobal:i++}],rect:p,wordIndexGlobal:o++,wordIndexInLine:d,isBeforeElement:!1,isAfterElement:!1};t.words.push(h),t.rect=Yt(t.words.map(y=>y.rect))}}),e}function Yt(l){let e=Math.min(...l.map(o=>o.left)),t=Math.min(...l.map(o=>o.top)),r=Math.max(...l.map(o=>o.right)),i=Math.max(...l.map(o=>o.bottom));return new DOMRect(e,t,r-e,i-t)}var Et=class extends g{constructor(e){super(e),this.htmlKey="split"}onResize(){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 o=t.getAttribute("string-split")??t.getAttribute("data-string-split")??"",n=this.tools.optionsParser.process({attributeValue:o}),{fragment:s,result:a}=this.split(t,n);e.setProperty("nodes",s.childNodes),t.innerHTML="",t.appendChild(a)}split(e,t){let r=document.createDocumentFragment();e.childNodes.forEach(a=>r.appendChild(a.cloneNode(!0)));let i=zt(r.childNodes),o=$t(i,e),n=Ut(o);this.applyCalculatedValues(n,t);let s=qt(n,t);return{fragment:r,result:s}}computeValue(e,t,r){if(e.align.startsWith("random")){let i=e.random?.min??0,o=e.random?.max??r-1;return Math.floor(Math.random()*(o-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=n=>n.words.reduce((s,a)=>s+a.chars.length,0),i=e.reduce((n,s)=>n+s.words.length,0),o=e.reduce((n,s)=>n+s.words.reduce((a,u)=>a+u.chars.length,0),0);e.forEach((n,s)=>{t.line&&(n.calculatedValues=t.line.map(a=>({type:"line",align:a.align,value:this.computeValue(a,s,e.length)}))),n.words.forEach((a,u)=>{t.word&&(a.calculatedValues=t.word.map(c=>({type:"word",align:c.align,value:this.computeValue(c,a.wordIndexGlobal,i)}))),t.wordLine&&(a.calculatedValues??(a.calculatedValues=[]),a.calculatedValues.push(...t.wordLine.map(c=>({type:"wordLine",align:c.align,value:this.computeValue(c,a.wordIndexInLine,n.words.length)}))));let p=r(n);a.chars.forEach(c=>{let d=[];t.char&&d.push(...t.char.map(m=>({type:"char",align:m.align,value:this.computeValue(m,c.charIndexGlobal,o)}))),t.charWord&&d.push(...t.charWord.map(m=>({type:"charWord",align:m.align,value:this.computeValue(m,c.charIndexInWord,a.chars.length)}))),t.charLine&&d.push(...t.charLine.map(m=>({type:"charLine",align:m.align,value:this.computeValue(m,c.charIndexInLine,p)}))),c.calculatedValues=d})})})}escapeAttribute(e){return e.replace(/src="(https?:\/\/[^"\s]+)"/g,"src=$1")}};var Ct=class extends g{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((o,n)=>{let s=n,a=i-o*this.height;n===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 wt=class extends g{constructor(t){super(t);this.frameCount=0;this._type=2}onInit(){this.createDisplayElement(),this.intervalId=window.setInterval(()=>{this.displayElement.textContent=`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 Tt=class extends g{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((o,n)=>{let s=n,a=i-o/2;n===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 Lt=class extends g{constructor(e){super(e),this._type=2}onInit(){this.createDisplayElement()}onScroll(e){let t=e.scroll.current,r=e.scroll.target,i=t<r?"\u2193":t>r?"\u2191":"-";this.displayElement.setAttribute("data-dir",i),this.displayElement.setAttribute("data-val",`${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(t),this.displayElement=e}};function Yt(l,e){let t=null;return function(...r){let i=this;t&&clearTimeout(t),t=setTimeout(()=>{l.apply(i,r),t=null},e)}}var Pt=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 It=class extends g{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 Ft=class l{constructor(){this.prevWidth=0;this.prevHeight=0;this.loop=new Pt;this.debouncedResize=Yt(this.onResize,30);this.root=document.body,this.window=window,this.tools=new lt,this.data=new R,this.eventManager=new I,this.moduleManager=new Q(this.data),this.objectManager=new G(this.data,this.moduleManager,this.eventManager),this.context={events:this.eventManager,data:this.data,tools:this.tools,settings:{}},this.cursorController=new K(1,this.context),this.scrollManager=new et(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}),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.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.delta=0,this.data.scroll.lerped=0,this.scrollManager.updatePosition()}set scrollContainer(e){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.debouncedResize()}get speed(){return this.data.scroll.current}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 l.i||(l.i=new l),l.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});this.moduleManager.register(i)}on(e,t,r=""){this.eventManager.on(e,t,r)}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),new ResizeObserver(()=>{this.debouncedResize()}).observe(this.context.data.scroll.container);let r=new MutationObserver((s,a)=>{for(let u of s)u.type==="attributes"&&(u.attributeName==="style"||u.attributeName==="class")&&this.onResize()}),i={attributes:!0,attributeFilter:["style","class"]};r.observe(this.context.data.scroll.container,i),this.use(mt);let o=window.getComputedStyle(document.documentElement).fontSize,n=parseFloat(o);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.enqueueConnection(t,e)}),this.moduleManager.onResize(),this.moduleManager.onScroll(),this.moduleManager.onFrame()}setupSettings(e){this.context.settings={...this.context.settings,...e},this.onSettingsChange()}onMouseMoveEvent(e){this.cursorController.onMouseMove(e),this.moduleManager.onMouseMove(e)}onWheelEvent(e){e.target.closest("[string-isolation],[data-string-isolation]")==null&&(this.scrollManager.get().onWheel(e),this.moduleManager.onWheel(e))}onScrollStart(){this.moduleManager.onScrollStart()}onScrollStop(){this.moduleManager.onScrollStop()}onDirectionChange(){this.moduleManager.onDirectionChange()}onSettingsChange(){this.cursorController.onSettingsChange(),this.objectManager.onSettingsChange(),this.moduleManager.onSettingsChange()}onScrollEvent(e){return e.preventDefault(),this.scrollManager.get().onScroll(e),this.moduleManager.onScroll(),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(){let e=this.data.scroll.container,t=this.context.data.scroll,r=0,i=0;var o,n=0;let s=e.getBoundingClientRect();e.tagName=="BODY"?(r=window.innerWidth,i=window.innerHeight):(r=s.width,i=s.height),n=s.top,o=t.container.scrollHeight;let a=this.tools.transformScaleParser.process({value:window.getComputedStyle(e).transform});this.context.data.viewport.transformScale=a;let u=r>1080,d=this.prevWidth!==r,c=this.prevHeight!==i,p=this.context.data.viewport.contentHeight!==o,m=d||u&&c||p;this.context.data.scroll.topPosition=n,this.context.data.viewport.contentWidth=r,this.context.data.viewport.contentHeight=o,this.prevWidth=r,this.prevHeight=i,this.context.data.viewport.windowWidth=r,this.context.data.viewport.windowHeight=i;let f=window.getComputedStyle(document.documentElement).fontSize,h=parseFloat(f);this.context.data.viewport.baseRem=h*a,t.bottomPosition=this.context.data.viewport.contentHeight-i,m&&(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(),this.moduleManager.onScroll(),this.moduleManager.onFrame())}destroy(){this.data.scroll.scrollContainer?.removeEventListener("scroll",this.onScrollBind),this.data.scroll.container?.removeEventListener("wheel",this.onScrollBind),this.window.removeEventListener("resize",this.onResizeBind),this.root.removeEventListener("mousemove",this.onMouseMoveBind),this.loop.stop(),this.moduleManager.destroy(),this.eventManager.clearAll()}};0&&(module.exports={StringAnchor,StringCursor,StringData,StringDelayLerpTracker,StringFPSTracker,StringGlide,StringLazy,StringLerp,StringLerpTracker,StringLoading,StringMagnetic,StringModule,StringObject,StringParallax,StringPositionTracker,StringProgress,StringResponsive,StringScrollbar,StringSplit,StringTune,StringVideoAutoplay});
|
23
|
+
`,document.head.appendChild(t),this.displayElement=e}};function Xt(l,e){let t=null;return function(...r){let i=this;t&&clearTimeout(t),t=setTimeout(()=>{l.apply(i,r),t=null},e)}}var Pt=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 It=class extends g{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 Vt=(r=>(r.ACTIVE="-active",r.HIDE="-hide",r.DISABLE="-disable",r))(Vt||{});var Ot=class extends g{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(o=>{let n=o.getProperty("sequence");n==`${t}[${this.hideStepForSlides.get(t)}]`&&n!=`${t}[${r}]`&&this.setSequenceState(o,"-disable"),n==`${t}[${this.activeStepForSlides.get(t)}]`&&this.setSequenceState(o,"-hide"),n==`${t}[${r}]`&&this.setSequenceState(o,"-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(Vt)),t.htmlElement.classList.add(r)})}};var Nt=class l{constructor(){this.prevWidth=0;this.prevHeight=0;this.loop=new Pt;this.debouncedResize=Xt(this.onResize,30);this.root=document.body,this.window=window,this.tools=new lt,this.data=new R,this.eventManager=new I,this.moduleManager=new Q(this.data),this.objectManager=new G(this.data,this.moduleManager,this.eventManager),this.context={events:this.eventManager,data:this.data,tools:this.tools,settings:{}},this.cursorController=new K(1,this.context),this.scrollManager=new et(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}),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.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()}set scrollContainer(e){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.debouncedResize()}get speed(){return this.data.scroll.current}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 l.i||(l.i=new l),l.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});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),new ResizeObserver(()=>{this.debouncedResize()}).observe(this.context.data.scroll.container);let r=new MutationObserver((s,a)=>{for(let u of s)u.type==="attributes"&&(u.attributeName==="style"||u.attributeName==="class")&&this.onResize()}),i={attributes:!0,attributeFilter:["style","class"]};r.observe(this.context.data.scroll.container,i),this.use(mt);let o=window.getComputedStyle(document.documentElement).fontSize,n=parseFloat(o);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.enqueueConnection(t,e)}),this.moduleManager.onResize(),this.moduleManager.onScroll(),this.moduleManager.onFrame()}setupSettings(e){this.context.settings={...this.context.settings,...e},this.onSettingsChange()}onMouseMoveEvent(e){this.cursorController.onMouseMove(e),this.moduleManager.onMouseMove(e)}onWheelEvent(e){e.target.closest("[string-isolation],[data-string-isolation]")==null&&(this.scrollManager.get().onWheel(e),this.moduleManager.onWheel(e))}onScrollStart(){this.moduleManager.onScrollStart()}onScrollStop(){this.moduleManager.onScrollStop()}onDirectionChange(){this.moduleManager.onDirectionChange()}onSettingsChange(){this.cursorController.onSettingsChange(),this.objectManager.onSettingsChange(),this.moduleManager.onSettingsChange()}onScrollEvent(e){return e.preventDefault(),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),!1}onUpdateEvent(){this.cursorController.onFrame(),this.scrollManager.get().onFrame(),this.moduleManager.onFrame(),this.eventManager.emit("update",null)}onResize(){let e=this.data.scroll.container,t=this.context.data.scroll,r=0,i=0;var o,n=0;let s=e.getBoundingClientRect();e.tagName=="BODY"?(r=window.innerWidth,i=window.innerHeight):(r=s.width,i=s.height),n=s.top,o=t.container.scrollHeight;let a=this.tools.transformScaleParser.process({value:window.getComputedStyle(e).transform});this.context.data.viewport.transformScale=a;let u=r>1080,p=this.prevWidth!==r,c=this.prevHeight!==i,d=this.context.data.viewport.contentHeight!==o,m=p||u&&c||d;this.context.data.scroll.topPosition=n,this.context.data.viewport.contentWidth=r,this.context.data.viewport.contentHeight=o,this.prevWidth=r,this.prevHeight=i,this.context.data.viewport.windowWidth=r,this.context.data.viewport.windowHeight=i;let f=window.getComputedStyle(document.documentElement).fontSize,h=parseFloat(f);this.context.data.viewport.baseRem=h*a,t.bottomPosition=this.context.data.viewport.contentHeight-i,m&&(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(),this.moduleManager.onScroll(),this.moduleManager.onFrame())}destroy(){this.data.scroll.scrollContainer?.removeEventListener("scroll",this.onScrollBind),this.data.scroll.container?.removeEventListener("wheel",this.onScrollBind),this.window.removeEventListener("resize",this.onResizeBind),this.root.removeEventListener("mousemove",this.onMouseMoveBind),this.loop.stop(),this.moduleManager.destroy(),this.eventManager.clearAll()}};0&&(module.exports={StringAnchor,StringCursor,StringData,StringDelayLerpTracker,StringFPSTracker,StringGlide,StringLazy,StringLerp,StringLerpTracker,StringLoading,StringMagnetic,StringModule,StringObject,StringParallax,StringPositionTracker,StringProgress,StringResponsive,StringScrollbar,StringSequence,StringSplit,StringTune,StringVideoAutoplay});
|
24
24
|
//# sourceMappingURL=index.cjs.map
|