masoneffect 2.0.14 → 2.0.17

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.
@@ -1 +1 @@
1
- "use strict";var t=Object.defineProperty,i=(i,e,n)=>((i,e,n)=>e in i?t(i,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[e]=n)(i,"symbol"!=typeof e?e+"":e,n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("svelte");function n(){}function s(t){return t()}function o(){return Object.create(null)}function r(t){t.forEach(s)}function a(t){return"function"==typeof t}function h(t,i){return t!=t?i==i:t!==i||t&&"object"==typeof t||"function"==typeof t}function l(t,i,e){t.$$.on_destroy.push(function(t,...i){if(null==t){for(const t of i)t(void 0);return n}const e=t.subscribe(...i);return e.unsubscribe?()=>e.unsubscribe():e}(i,e))}function c(t,i,e,n){return t[1]&&n?function(t,i){for(const e in i)t[e]=i[e];return t}(e.ctx.slice(),t[1](n(i))):e.ctx}function d(t,i,e){t.insertBefore(i,e||null)}function u(t){t.parentNode&&t.parentNode.removeChild(t)}function g(t){return document.createElement(t)}function f(t,i,e){null==e?t.removeAttribute(i):t.getAttribute(i)!==e&&t.setAttribute(i,e)}let p;function m(t){p=t}const y=[],x=[];let b=[];const v=[],M=Promise.resolve();let $=!1;function C(t){b.push(t)}const w=new Set;let T=0;function S(){if(0!==T)return;const t=p;do{try{for(;T<y.length;){const t=y[T];T++,m(t),V(t.$$)}}catch(i){throw y.length=0,T=0,i}for(m(null),y.length=0,T=0;x.length;)x.pop()();for(let t=0;t<b.length;t+=1){const i=b[t];w.has(i)||(w.add(i),i())}b.length=0}while(y.length);for(;v.length;)v.pop()();$=!1,w.clear(),m(t)}function V(t){if(null!==t.fragment){t.update(),r(t.before_update);const i=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,i),t.after_update.forEach(C)}}const R=new Set;function D(t,i){t&&t.i&&(R.delete(t),t.i(i))}function O(t,i){const e=t.$$;null!==e.fragment&&(!function(t){const i=[],e=[];b.forEach(n=>-1===t.indexOf(n)?i.push(n):e.push(n)),e.forEach(t=>t()),b=i}(e.after_update),r(e.on_destroy),e.fragment&&e.fragment.d(i),e.on_destroy=e.fragment=null,e.ctx=[])}function E(t,i){-1===t.$$.dirty[0]&&(y.push(t),$||($=!0,M.then(S)),t.$$.dirty.fill(0)),t.$$.dirty[i/31|0]|=1<<i%31}function P(t,i,e,h,l,c,d=null,g=[-1]){const f=p;m(t);const y=t.$$={fragment:null,ctx:[],props:c,update:n,not_equal:l,bound:o(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(i.context||(f?f.$$.context:[])),callbacks:o(),dirty:g,skip_bound:!1,root:i.target||f.$$.root};d&&d(y.root);let x=!1;if(y.ctx=e?e(t,i.props||{},(i,e,...n)=>{const s=n.length?n[0]:e;return y.ctx&&l(y.ctx[i],y.ctx[i]=s)&&(!y.skip_bound&&y.bound[i]&&y.bound[i](s),x&&E(t,i)),e}):[],y.update(),x=!0,r(y.before_update),y.fragment=!!h&&h(y.ctx),i.target){if(i.hydrate){const t=(b=i.target,Array.from(b.childNodes));y.fragment&&y.fragment.l(t),t.forEach(u)}else y.fragment&&y.fragment.c();i.intro&&D(t.$$.fragment),function(t,i,e){const{fragment:n,after_update:o}=t.$$;n&&n.m(i,e),C(()=>{const i=t.$$.on_mount.map(s).filter(a);t.$$.on_destroy?t.$$.on_destroy.push(...i):r(i),t.$$.on_mount=[]}),o.forEach(C)}(t,i.target,i.anchor),S()}var b;m(f)}class H{constructor(){i(this,"$$"),i(this,"$$set")}$destroy(){O(this,1),this.$destroy=n}$on(t,i){if(!a(i))return n;const e=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return e.push(i),()=>{const t=e.indexOf(i);-1!==t&&e.splice(t,1)}}$set(t){var i;this.$$set&&(i=t,0!==Object.keys(i).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}"undefined"!=typeof window&&(window.__svelte||(window.__svelte={v:new Set})).v.add("4");class I{constructor(t,i={}){this.container=t,this.options={threshold:i.threshold??.1,rootMargin:i.rootMargin??"0px",root:i.root??null,onVisible:i.onVisible,onHidden:i.onHidden},this.intersectionObserver=null,this.visibilityChangeHandler=null,this.isVisible=!1,this.isPageVisible="undefined"==typeof document||!document.hidden,this.setupIntersectionObserver(),this.setupPageVisibility()}setupIntersectionObserver(){if("undefined"==typeof window||void 0===window.IntersectionObserver)return this.isVisible=!0,void(this.isPageVisible&&this.options.onVisible&&this.options.onVisible());this.intersectionObserver=new IntersectionObserver(t=>{for(const i of t)i.target===this.container&&(i.isIntersecting?(this.isVisible=!0,this.isPageVisible&&this.options.onVisible&&this.options.onVisible()):(this.isVisible=!1,this.options.onHidden&&this.options.onHidden()))},{threshold:this.options.threshold,rootMargin:this.options.rootMargin,root:this.options.root||null}),this.intersectionObserver.observe(this.container)}setupPageVisibility(){"undefined"!=typeof document&&(this.visibilityChangeHandler=()=>{const t=this.isPageVisible;this.isPageVisible=!document.hidden,document.hidden?this.options.onHidden&&this.options.onHidden():t!==this.isPageVisible&&this.isVisible&&this.options.onVisible&&this.options.onVisible()},document.addEventListener("visibilitychange",this.visibilityChangeHandler),document.hidden&&this.isVisible&&this.options.onHidden&&this.options.onHidden())}getIsVisible(){return this.isVisible&&this.isPageVisible}updateOptions(t){this.options={...this.options,...t},this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.setupIntersectionObserver()}destroy(){this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.visibilityChangeHandler&&"undefined"!=typeof document&&(document.removeEventListener("visibilitychange",this.visibilityChangeHandler),this.visibilityChangeHandler=null)}}function F(t,i){let e=null;return function(...n){null!==e&&clearTimeout(e),e=setTimeout(()=>{e=null,t.apply(this,n)},i)}}class U{constructor(t,i={}){if(this.container="string"==typeof t?document.querySelector(t):t,!this.container)throw new Error("Container element not found");this.config={text:i.text||"mason effect",densityStep:i.densityStep??2,maxParticles:i.maxParticles??3200,pointSize:i.pointSize??.5,ease:i.ease??.05,repelRadius:i.repelRadius??150,repelStrength:i.repelStrength??1,particleColor:i.particleColor||"#fff",fontFamily:i.fontFamily||"Inter, system-ui, Arial",fontSize:i.fontSize||null,width:i.width||null,height:i.height||null,devicePixelRatio:i.devicePixelRatio??null,onReady:i.onReady||null,onUpdate:i.onUpdate||null},this.canvas=document.createElement("canvas");const e=this.canvas.getContext("2d",{willReadFrequently:!0});if(!e)throw new Error("Canvas context not available");this.ctx=e,this.container.appendChild(this.canvas),this.canvas.style.display="block",this.offCanvas=document.createElement("canvas");const n=this.offCanvas.getContext("2d",{willReadFrequently:!0});if(!n)throw new Error("Offscreen canvas context not available");this.offCtx=n,this.W=0,this.H=0,this.DPR=this.config.devicePixelRatio||Math.min(window.devicePixelRatio||1,1.8),this.particles=[],this.mouse={x:0,y:0,down:!1},this.animationId=null,this.isRunning=!1,this.visibilityManager=null,this.debounceDelay=i.debounceDelay??150;const s=this.handleResize.bind(this);this.handleResize=F(s,this.debounceDelay),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this._debouncedMorph=F(this._morphInternal.bind(this),this.debounceDelay),this._debouncedUpdateConfig=F(this._updateConfigInternal.bind(this),this.debounceDelay),this.init()}init(){this.resize(),this.setupEventListeners(),this.setupVisibilityManager(),this.config.onReady&&this.config.onReady(this)}setupVisibilityManager(){this.visibilityManager=new I(this.container,{threshold:.1,onVisible:()=>{this.start()},onHidden:()=>{this.stop()}})}resize(){const t=this.container.getBoundingClientRect(),i=this.config.width||t.width||this.container.clientWidth||window.innerWidth,e=this.config.height||t.height||this.container.clientHeight||.7*window.innerHeight;if(i<=0||e<=0)return;this.W=Math.floor(i*this.DPR),this.H=Math.floor(e*this.DPR);const n=4096;if(this.W>n||this.H>n){const t=Math.min(n/this.W,n/this.H);this.W=Math.floor(this.W*t),this.H=Math.floor(this.H*t),this.DPR=this.DPR*t}this.canvas.width=this.W,this.canvas.height=this.H,this.canvas.style.width=i+"px",this.canvas.style.height=e+"px",this.W>0&&this.H>0&&(this.buildTargets(),this.particles.length||this.initParticles())}measureTextFit(t,i,e,n){this.offCtx.font=`400 ${t}px ${this.config.fontFamily}`;const s=i.split("\n"),o=t,r=.1*t,a=.05*t;let h=0;for(const c of s){if(0===c.length)continue;const t=this.offCtx.measureText(c).width+a*(c.length>0?c.length-1:0);h=Math.max(h,t)}const l=s.length>0?o*s.length+r*(s.length-1):o;return{width:h,height:l,fits:h<=e&&l<=n}}findOptimalFontSize(t,i,e,n){if(this.measureTextFit(n,t,i,e).fits)return n;if(n<=12)return 12;let s=12,o=n,r=12;for(;s<=o;){const n=Math.floor((s+o)/2);this.measureTextFit(n,t,i,e).fits?(r=n,s=n+1):o=n-1}return r}buildTargets(){if(this.W<=0||this.H<=0)return;const t=this.config.text;this.offCanvas.width=this.W,this.offCanvas.height=this.H,this.offCtx.clearRect(0,0,this.offCanvas.width,this.offCanvas.height);const i=Math.min(this.W,this.H),e=this.config.fontSize||Math.max(80,Math.floor(.18*i)),n=this.W-80,s=this.H-80,o=this.findOptimalFontSize(t,n,s,e);this.offCtx.fillStyle="#ffffff",this.offCtx.textAlign="center",this.offCtx.textBaseline="middle",this.offCtx.font=`400 ${o}px ${this.config.fontFamily}`;const r=t.split("\n"),a=o,h=.1*o,l=.05*o,c=r.length>0?a*r.length+h*(r.length-1):a;let d=this.H/2-c/2+a/2;for(const p of r){if(0===p.length){d+=a+h;continue}const t=p.split(""),i=this.offCtx.measureText(p).width+l*(t.length>0?t.length-1:0);let e=this.W/2-i/2;for(const n of t)this.offCtx.fillText(n,e+this.offCtx.measureText(n).width/2,d),e+=this.offCtx.measureText(n).width+l;d+=a+h}const u=Math.max(2,this.config.densityStep),g=this.offCtx.getImageData(0,0,this.W,this.H).data,f=[];for(let p=0;p<this.H;p+=u)for(let t=0;t<this.W;t+=u){const i=4*(p*this.W+t);g[i]+g[i+1]+g[i+2]>600&&f.push({x:t,y:p})}for(;f.length>this.config.maxParticles;)f.splice(Math.floor(Math.random()*f.length),1);if(this.particles.length<f.length){const t=f.length-this.particles.length;for(let i=0;i<t;i++)this.particles.push(this.makeParticle())}else this.particles.length>f.length&&(this.particles.length=f.length);for(let p=0;p<this.particles.length;p++){const t=this.particles[p],i=f[p];t.tx=i.x,t.ty=i.y}}makeParticle(){const t=Math.random()*this.W,i=Math.random()*this.H;return{x:t,y:i,vx:0,vy:0,tx:t,ty:i,initialX:t,initialY:i,j:Math.random()*Math.PI*2}}initParticles(){for(const t of this.particles){const i=Math.random()*this.W,e=Math.random()*this.H;t.x=i,t.y=e,t.vx=t.vy=0,t.initialX=i,t.initialY=e}}scatter(){for(const t of this.particles)void 0!==t.initialX&&void 0!==t.initialY?(t.tx=t.initialX,t.ty=t.initialY):(t.initialX=t.x,t.initialY=t.y,t.tx=t.initialX,t.ty=t.initialY)}morph(t){this._debouncedMorph(t)}_morphInternal(t){if(0!==this.W&&0!==this.H||this.resize(),"string"==typeof t)this.config.text=t,this.buildTargets();else if(t&&"object"==typeof t){const i=void 0!==t.text;this.config={...this.config,...t},i&&this.buildTargets()}else this.buildTargets()}update(){this.ctx.clearRect(0,0,this.W,this.H);for(const n of this.particles){let t=(n.tx-n.x)*this.config.ease,i=(n.ty-n.y)*this.config.ease;if(this.mouse.x||this.mouse.y){const e=n.x-this.mouse.x,s=n.y-this.mouse.y,o=e*e+s*s,r=this.config.repelRadius*this.DPR;if(o<r*r){const n=Math.sqrt(o)+1e-4,a=(this.mouse.down?-1:1)*this.config.repelStrength*(1-n/r);t+=e/n*a*6,i+=s/n*a*6}}n.j+=2,t+=.05*Math.cos(n.j),i+=.05*Math.sin(1.3*n.j),n.vx=(n.vx+t)*Math.random(),n.vy=(n.vy+i)*Math.random(),n.x+=n.vx,n.y+=n.vy}this.ctx.fillStyle=this.config.particleColor;const t=Math.min(this.W,this.H)/this.DPR,i=Math.max(.5,Math.min(2,t/1920)),e=this.config.pointSize*this.DPR*i;for(const n of this.particles)this.ctx.beginPath(),this.ctx.arc(n.x,n.y,e,0,2*Math.PI),this.ctx.fill();this.config.onUpdate&&this.config.onUpdate(this)}animate(){this.isRunning&&(this.update(),this.animationId=requestAnimationFrame(()=>this.animate()))}start(){this.isRunning||(this.isRunning=!0,this.animate())}stop(){this.isRunning=!1,this.animationId&&(cancelAnimationFrame(this.animationId),this.animationId=null)}setupEventListeners(){window.addEventListener("resize",this.handleResize),this.canvas.addEventListener("mousemove",this.handleMouseMove),this.canvas.addEventListener("mouseleave",this.handleMouseLeave),this.canvas.addEventListener("mousedown",this.handleMouseDown),window.addEventListener("mouseup",this.handleMouseUp)}removeEventListeners(){window.removeEventListener("resize",this.handleResize),this.canvas.removeEventListener("mousemove",this.handleMouseMove),this.canvas.removeEventListener("mouseleave",this.handleMouseLeave),this.canvas.removeEventListener("mousedown",this.handleMouseDown),window.removeEventListener("mouseup",this.handleMouseUp)}handleResize(){this.resize()}handleMouseMove(t){const i=this.canvas.getBoundingClientRect();this.mouse.x=(t.clientX-i.left)*this.DPR,this.mouse.y=(t.clientY-i.top)*this.DPR}handleMouseLeave(){this.mouse.x=this.mouse.y=0}handleMouseDown(){this.mouse.down=!0}handleMouseUp(){this.mouse.down=!1}updateConfig(t){this._debouncedUpdateConfig(t)}_updateConfigInternal(t){this.config={...this.config,...t},t.text&&this.buildTargets()}destroy(){this.stop(),this.removeEventListeners(),this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null),this.canvas&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)}}const _={linear:t=>t};class L{constructor(t,i){if(this.container="string"==typeof t?document.querySelector(t):t,!this.container)throw new Error("Container element not found");this.config={targetValue:i.targetValue,duration:i.duration??2e3,startValue:i.startValue??0,enabled:i.enabled??!0,easing:i.easing??_.linear,threshold:i.threshold??.2,rootMargin:i.rootMargin??"0px 0px -100px 0px",triggerOnce:i.triggerOnce??!1,onUpdate:i.onUpdate||null,onComplete:i.onComplete||null},this.currentValue=this.config.startValue,this.startTime=null,this.animationFrameId=null,this.visibilityManager=null,this.isRunning=!1,this.hasTriggered=!1,this.init()}init(){this.updateDisplay(this.config.startValue),this.setupVisibilityManager()}setupVisibilityManager(){this.visibilityManager=new I(this.container,{threshold:this.config.threshold,rootMargin:this.config.rootMargin,onVisible:()=>{!this.hasTriggered&&this.config.enabled&&(this.hasTriggered=!0,this.start())},onHidden:()=>{!this.config.triggerOnce&&this.isRunning&&this.reset()}})}start(){if(this.isRunning)return;if(!this.config.enabled)return;this.isRunning=!0,this.startTime=null,this.currentValue=this.config.startValue,this.updateDisplay(this.currentValue);const t=i=>{null===this.startTime&&(this.startTime=i);const e=i-this.startTime,n=Math.min(e/this.config.duration,1),s=this.config.easing(n);this.currentValue=Math.floor(this.config.startValue+(this.config.targetValue-this.config.startValue)*s),this.updateDisplay(this.currentValue),this.config.onUpdate&&this.config.onUpdate(this.currentValue),n<1?this.animationFrameId=requestAnimationFrame(t):(this.currentValue=this.config.targetValue,this.updateDisplay(this.currentValue),this.isRunning=!1,this.config.onComplete&&this.config.onComplete())};this.animationFrameId=requestAnimationFrame(t)}stop(){this.isRunning=!1,null!==this.animationFrameId&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null)}reset(){this.stop(),this.currentValue=this.config.startValue,this.updateDisplay(this.currentValue),this.hasTriggered=!1,this.startTime=null}updateDisplay(t){this.container.textContent=this.formatNumber(t)}formatNumber(t){return Math.floor(t).toLocaleString()}updateConfig(t){const i=this.isRunning;this.stop(),this.config={...this.config,...t,onUpdate:void 0!==t.onUpdate?t.onUpdate:this.config.onUpdate,onComplete:void 0!==t.onComplete?t.onComplete:this.config.onComplete},void 0!==t.targetValue?(this.reset(),i&&this.config.enabled&&this.start()):i&&this.config.enabled&&this.start()}getValue(){return this.currentValue}destroy(){this.stop(),this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null)}}function z(t){const i=t.charCodeAt(0);if(i<44032||i>55203)return[t];const e=i-44032,n=Math.floor(e/588),s=Math.floor(e%588/28),o=e%28,r=["","ㄱ","ㄲ","ㄳ","ㄴ","ㄵ","ㄶ","ㄷ","ㄹ","ㄺ","ㄻ","ㄼ","ㄽ","ㄾ","ㄿ","ㅀ","ㅁ","ㅂ","ㅄ","ㅅ","ㅆ","ㅇ","ㅈ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ"],a=[];return a.push(["ㄱ","ㄲ","ㄴ","ㄷ","ㄸ","ㄹ","ㅁ","ㅂ","ㅃ","ㅅ","ㅆ","ㅇ","ㅈ","ㅉ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ"][n]),a.push(["ㅏ","ㅐ","ㅑ","ㅒ","ㅓ","ㅔ","ㅕ","ㅖ","ㅗ","ㅘ","ㅙ","ㅚ","ㅛ","ㅜ","ㅝ","ㅞ","ㅟ","ㅠ","ㅡ","ㅢ","ㅣ"][s]),o>0&&a.push(r[o]),a}function N(t,i,e){const n=["ㄱ","ㄲ","ㄴ","ㄷ","ㄸ","ㄹ","ㅁ","ㅂ","ㅃ","ㅅ","ㅆ","ㅇ","ㅈ","ㅉ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ"].indexOf(t),s=["ㅏ","ㅐ","ㅑ","ㅒ","ㅓ","ㅔ","ㅕ","ㅖ","ㅗ","ㅘ","ㅙ","ㅚ","ㅛ","ㅜ","ㅝ","ㅞ","ㅟ","ㅠ","ㅡ","ㅢ","ㅣ"].indexOf(i),o=e?["","ㄱ","ㄲ","ㄳ","ㄴ","ㄵ","ㄶ","ㄷ","ㄹ","ㄺ","ㄻ","ㄼ","ㄽ","ㄾ","ㄿ","ㅀ","ㅁ","ㅂ","ㅄ","ㅅ","ㅆ","ㅇ","ㅈ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ"].indexOf(e):0;if(-1===n||-1===s)return t+(i||"")+(e||"");const r=44032+21*n*28+28*s+o;return String.fromCharCode(r)}function A(t){const i=[],e=[];for(let n=0;n<t.length;n++){const s=t[n],o=s.charCodeAt(0),r=i.length;if(o>=44032&&o<=55203){const t=z(s);i.push(...t),e.push({start:r,end:i.length,isHangul:!0})}else i.push(s),e.push({start:r,end:i.length,isHangul:!1})}return{units:i,charUnitRanges:e}}class W{constructor(t,i){if(this.container="string"==typeof t?document.querySelector(t):t,!this.container)throw new Error("Container element not found");this.originalText=i.text,this.config={text:i.text,speed:i.speed??50,delay:i.delay??0,enabled:i.enabled??!0,threshold:i.threshold??.2,rootMargin:i.rootMargin??"0px 0px -100px 0px",triggerOnce:i.triggerOnce??!1,showCursor:i.showCursor??!0,cursorChar:i.cursorChar??"|",onUpdate:i.onUpdate||null,onComplete:i.onComplete||null};const e=A(this.config.text);this.textUnits=e.units,this.charUnitRanges=e.charUnitRanges,this.currentIndex=0,this.displayedText="",this.timeoutId=null,this.visibilityManager=null,this.isRunning=!1,this.hasTriggered=!1,this.init()}init(){this.updateDisplay(""),this.injectStyles(),this.setupVisibilityManager()}injectStyles(){if(document.getElementById("masoneffect-typing-styles"))return;const t=document.createElement("style");t.id="masoneffect-typing-styles",t.textContent="\n .typing-char {\n transition: opacity 0.3s ease-in;\n display: inline-block;\n }\n .typing-cursor {\n display: inline-block;\n }\n ",document.head.appendChild(t),this.container.style.whiteSpace="pre-wrap"}setupVisibilityManager(){this.visibilityManager=new I(this.container,{threshold:this.config.threshold,rootMargin:this.config.rootMargin,onVisible:()=>{!this.hasTriggered&&this.config.enabled&&(this.hasTriggered=!0,setTimeout(()=>this.start(),this.config.delay))},onHidden:()=>{}})}buildTextFromUnits(t){if(0===t)return"";let i="";for(let e=0;e<this.charUnitRanges.length;e++){const n=this.charUnitRanges[e];if(n.start>=t)break;const s=Math.min(t-n.start,n.end-n.start);if(s<=0)break;if(n.isHangul){const t=this.textUnits.slice(n.start,n.start+s);1===t.length?i+=t[0]:2===t.length?i+=N(t[0],t[1]):t.length>=3&&(i+=N(t[0],t[1],t[2]))}else s>0&&(i+=this.textUnits[n.start])}return i}start(){this.isRunning||(this.isRunning=!0,this.currentIndex=0,this.displayedText="",this.typeNext())}typeNext(){if(this.currentIndex>=this.textUnits.length)return this.isRunning=!1,this.config.showCursor&&this.updateDisplay(this.originalText),void(this.config.onComplete&&this.config.onComplete());this.displayedText=this.buildTextFromUnits(this.currentIndex+1);let t=this.displayedText;this.config.showCursor&&(t+=this.config.cursorChar),this.updateDisplay(t),this.config.onUpdate&&this.config.onUpdate(this.displayedText),this.currentIndex++,this.timeoutId=setTimeout(()=>{this.typeNext()},this.config.speed)}stop(){this.isRunning=!1,this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}reset(){this.stop(),this.currentIndex=0,this.displayedText="",this.hasTriggered=!1,this.updateDisplay("")}updateDisplay(t){const i=t.replace(new RegExp(this.escapeHtml(this.config.cursorChar)+"$"),""),e=t.endsWith(this.config.cursorChar),n=(this.container.textContent||"").replace(new RegExp(this.config.cursorChar+"$"),"");let s="";for(let r=0;r<i.length;r++){const t=i[r],e=r>=n.length,o=" "===t?"&nbsp;":this.escapeHtml(t);s+=e?`<span class="typing-char typing-fade-in" style="opacity: 0;">${o}</span>`:`<span class="typing-char" style="opacity: 1;">${o}</span>`}e&&(s+=`<span class="typing-cursor">${this.escapeHtml(this.config.cursorChar)}</span>`),this.container.innerHTML=s;const o=this.container.querySelectorAll(".typing-fade-in");o.length>0&&requestAnimationFrame(()=>{o.forEach(t=>{t.style.opacity="1",t.classList.remove("typing-fade-in")})})}escapeHtml(t){const i=document.createElement("div");return i.textContent=t,i.innerHTML}setText(t){this.originalText=t,this.config.text=t;const i=A(t);this.textUnits=i.units,this.charUnitRanges=i.charUnitRanges,this.reset(),this.config.enabled&&setTimeout(()=>this.start(),this.config.delay)}destroy(){this.stop(),this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null)}}const k=t=>--t*t*t+1;class q{constructor(t,i={}){if(this.container="string"==typeof t?document.querySelector(t):t,!this.container)throw new Error("Container element not found");this.config={direction:i.direction??"bottom",distance:i.distance??"50px",duration:i.duration??800,threshold:i.threshold??.1,rootMargin:i.rootMargin??"0px",root:i.root??null,triggerOnce:i.triggerOnce??!1,enabled:i.enabled??!0,onStart:i.onStart||null,onComplete:i.onComplete||null},this.easing=k,this.visibilityManager=null,this.animationFrameId=null,this.startTime=null,this.isRunning=!1,this.hasTriggered=!1,this.initialTransform="",this.targetDistance=0,this.init()}init(){const t=window.getComputedStyle(this.container);this.initialTransform="none"!==t.transform?t.transform:this.container.style.transform||"",this.targetDistance=this.parseDistance(this.config.distance),this.setInitialPosition(),this.setupVisibilityManager()}parseDistance(t){const i=t.match(/^(-?\d+\.?\d*)(px|rem|em|%|vh|vw)$/);if(!i){return parseFloat(t)||50}const e=parseFloat(i[1]);switch(i[2]){case"px":default:return e;case"rem":case"em":return e*(parseFloat(getComputedStyle(document.documentElement).fontSize)||16);case"%":const t=this.container.getBoundingClientRect();return e/100*("top"===this.config.direction||"bottom"===this.config.direction?t.height:t.width);case"vh":return e/100*window.innerHeight;case"vw":return e/100*window.innerWidth}}setInitialPosition(){let t=0,i=0;switch(this.config.direction){case"top":i=-this.targetDistance;break;case"right":t=this.targetDistance;break;case"bottom":i=this.targetDistance;break;case"left":t=-this.targetDistance}const e=this.initialTransform||"",n=`translate(${t}px, ${i}px)`;this.container.style.transform=e&&"none"!==e?`${n} ${e}`:n,this.container.style.opacity="0",this.container.style.transition="none"}setupVisibilityManager(){this.visibilityManager=new I(this.container,{threshold:this.config.threshold,rootMargin:this.config.rootMargin,root:this.config.root,onVisible:()=>{this.config.enabled&&(this.config.triggerOnce&&this.hasTriggered||(this.hasTriggered=!0,this.start()))},onHidden:()=>{this.config.enabled&&(this.stop(),this.config.triggerOnce||(this.hasTriggered=!1),this.setInitialPosition())}})}start(){this.isRunning||(this.isRunning=!0,this.startTime=performance.now(),this.config.onStart&&this.config.onStart(),this.container.style.transition="none",this.animate())}animate(){if(!this.isRunning)return;const t=performance.now()-(this.startTime||0),i=Math.min(t/this.config.duration,1),e=this.easing(i);let n=0,s=0;switch(this.config.direction){case"top":s=-this.targetDistance*(1-e);break;case"right":n=this.targetDistance*(1-e);break;case"bottom":s=this.targetDistance*(1-e);break;case"left":n=-this.targetDistance*(1-e)}const o=this.initialTransform||"",r=`translate(${n}px, ${s}px)`;this.container.style.transform=o&&"none"!==o?`${r} ${o}`:r,this.container.style.opacity=String(e),i<1?this.animationFrameId=requestAnimationFrame(()=>this.animate()):this.complete()}complete(){this.isRunning=!1,this.initialTransform&&"none"!==this.initialTransform?this.container.style.transform=this.initialTransform:this.container.style.transform="",this.container.style.opacity="1",this.animationFrameId&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null),this.config.onComplete&&this.config.onComplete()}reset(){this.stop(),this.hasTriggered=!1,this.setInitialPosition()}stop(){this.isRunning=!1,this.animationFrameId&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null)}updateConfig(t){const i=this.isRunning;this.stop(),this.config={...this.config,...t,onStart:t.onStart??this.config.onStart,onComplete:t.onComplete??this.config.onComplete},t.distance&&(this.targetDistance=this.parseDistance(this.config.distance)),this.setInitialPosition(),void 0===t.threshold&&void 0===t.rootMargin&&void 0===t.root||(this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null),this.setupVisibilityManager()),i&&this.config.enabled&&this.start()}destroy(){this.stop(),this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null),this.container.style.transform=this.initialTransform||"",this.container.style.opacity="",this.container.style.transition=""}}class j{constructor(t,i){if(this.container="string"==typeof t?document.querySelector(t):t,!this.container)throw new Error("Container element not found");if(!i.text)throw new Error("Text is required");this.config={text:i.text,delay:i.delay??.2,duration:i.duration??.6,randomDelay:i.randomDelay??2,threshold:i.threshold??.1,rootMargin:i.rootMargin??"0px",root:i.root??null,triggerOnce:i.triggerOnce??!1,enabled:i.enabled??!0,onStart:i.onStart||null,onComplete:i.onComplete||null},this.visibilityManager=null,this.textElements=[],this.randomPoints=[],this.hasTriggered=!1,this.isActive=!1,this.init()}init(){this.injectStyles(),this.createTextStructure(),this.setupVisibilityManager()}injectStyles(){if(document.getElementById("masoneffect-textspin-styles"))return;const t=document.createElement("style");t.id="masoneffect-textspin-styles",t.textContent="\n .masoneffect-textspin {\n display: inline-block;\n }\n .masoneffect-textspin-char {\n display: inline-block;\n opacity: 0;\n transform: rotateY(90deg);\n }\n .masoneffect-textspin-char.active {\n opacity: 1;\n transform: rotateY(0deg);\n }\n .masoneffect-textspin-char.space {\n width: 0.25em;\n }\n ",document.head.appendChild(t)}createTextStructure(){this.container.innerHTML="",this.textElements=[],this.randomPoints=[];const t=this.config.text.split("");t.forEach(()=>{this.randomPoints.push(Math.random())}),t.forEach((t,i)=>{const e=document.createElement("span");e.className="masoneffect-textspin-char",e.style.transition=`opacity ${this.config.duration}s ease-out, transform ${this.config.duration}s ease-out`," "===t?(e.classList.add("space"),e.innerHTML="&nbsp;"):e.textContent=t,this.container.appendChild(e),this.textElements.push(e)}),this.container.classList.add("masoneffect-textspin")}setupVisibilityManager(){this.visibilityManager=new I(this.container,{threshold:this.config.threshold,rootMargin:this.config.rootMargin,root:this.config.root,onVisible:()=>{this.config.enabled&&(this.config.triggerOnce&&this.hasTriggered||(this.hasTriggered=!0,this.start()))},onHidden:()=>{this.config.enabled&&(this.stop(),this.config.triggerOnce||(this.hasTriggered=!1))}})}start(){if(this.isActive)return;this.isActive=!0,this.config.onStart&&this.config.onStart(),this.textElements.forEach((t,i)=>{const e=this.config.delay+this.randomPoints[i]*this.config.randomDelay;t.style.transitionDelay=`${e}s`,requestAnimationFrame(()=>{t.classList.add("active")})});const t=this.config.delay+this.config.randomDelay+this.config.duration;setTimeout(()=>{this.config.onComplete&&this.config.onComplete()},1e3*t)}stop(){this.isActive&&(this.isActive=!1,this.textElements.forEach(t=>{t.classList.remove("active"),t.style.transitionDelay=""}))}reset(){this.stop(),this.hasTriggered=!1}updateText(t){this.config.text=t,this.createTextStructure(),this.isActive&&this.start()}updateTransitions(){this.textElements.forEach(t=>{t.style.transition=`opacity ${this.config.duration}s ease-out, transform ${this.config.duration}s ease-out`})}updateConfig(t){const i=this.isActive;this.stop(),this.config={...this.config,...t,text:t.text??this.config.text,onStart:t.onStart??this.config.onStart,onComplete:t.onComplete??this.config.onComplete},void 0!==t.text?this.createTextStructure():void 0!==t.duration&&this.updateTransitions(),void 0===t.threshold&&void 0===t.rootMargin&&void 0===t.root||(this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null),this.setupVisibilityManager()),i&&this.config.enabled&&this.start()}destroy(){this.stop(),this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null),this.container.innerHTML="",this.container.classList.remove("masoneffect-textspin")}}function Y(t){let i;return{c(){i=g("div"),f(i,"class",t[0]),f(i,"style",t[1])},m(e,n){d(e,i,n),t[21](i)},p(t,[e]){1&e&&f(i,"class",t[0]),2&e&&f(i,"style",t[1])},i:n,o:n,d(e){e&&u(i),t[21](null)}}}function B(t,i,n){let{text:s="mason effect"}=i,{densityStep:o=2}=i,{maxParticles:r=3200}=i,{pointSize:a=.5}=i,{ease:h=.05}=i,{repelRadius:l=150}=i,{repelStrength:c=1}=i,{particleColor:d="#fff"}=i,{fontFamily:u="Inter, system-ui, Arial"}=i,{fontSize:g=null}=i,{width:f=null}=i,{height:p=null}=i,{devicePixelRatio:m=null}=i,{className:y=""}=i,{style:b={}}=i;const v=e.createEventDispatcher();let M,$=null;return e.onMount(()=>{if(!M)return;n(20,$=new U(M,{text:s,densityStep:o,maxParticles:r,pointSize:a,ease:h,repelRadius:l,repelStrength:c,particleColor:d,fontFamily:u,fontSize:g,width:f,height:p,devicePixelRatio:m,onReady:t=>{v("ready",t)},onUpdate:t=>{v("update",t)}}))}),e.onDestroy(()=>{$&&($.destroy(),n(20,$=null))}),t.$$set=t=>{"text"in t&&n(3,s=t.text),"densityStep"in t&&n(4,o=t.densityStep),"maxParticles"in t&&n(5,r=t.maxParticles),"pointSize"in t&&n(6,a=t.pointSize),"ease"in t&&n(7,h=t.ease),"repelRadius"in t&&n(8,l=t.repelRadius),"repelStrength"in t&&n(9,c=t.repelStrength),"particleColor"in t&&n(10,d=t.particleColor),"fontFamily"in t&&n(11,u=t.fontFamily),"fontSize"in t&&n(12,g=t.fontSize),"width"in t&&n(13,f=t.width),"height"in t&&n(14,p=t.height),"devicePixelRatio"in t&&n(15,m=t.devicePixelRatio),"className"in t&&n(0,y=t.className),"style"in t&&n(1,b=t.style)},t.$$.update=()=>{1114104&t.$$.dirty&&$&&$.updateConfig({text:s,densityStep:o,maxParticles:r,pointSize:a,ease:h,repelRadius:l,repelStrength:c,particleColor:d,fontFamily:u,fontSize:g,width:f,height:p,devicePixelRatio:m})},[y,b,M,s,o,r,a,h,l,c,d,u,g,f,p,m,function(t){$&&$.morph(t)},function(){$&&$.scatter()},function(t){$&&$.updateConfig(t)},function(){$&&($.destroy(),n(20,$=null))},$,function(t){x[t?"unshift":"push"](()=>{M=t,n(2,M)})}]}class X extends H{constructor(t){super(),P(this,t,B,Y,h,{text:3,densityStep:4,maxParticles:5,pointSize:6,ease:7,repelRadius:8,repelStrength:9,particleColor:10,fontFamily:11,fontSize:12,width:13,height:14,devicePixelRatio:15,className:0,style:1,morph:16,scatter:17,updateConfig:18,destroy:19})}get morph(){return this.$$.ctx[16]}get scatter(){return this.$$.ctx[17]}get updateConfig(){return this.$$.ctx[18]}get destroy(){return this.$$.ctx[19]}}function G(t){let i;return{c(){i=g("div"),f(i,"class",t[0]),f(i,"style",t[1])},m(e,n){d(e,i,n),t[18](i)},p(t,[e]){1&e&&f(i,"class",t[0]),2&e&&f(i,"style",t[1])},i:n,o:n,d(e){e&&u(i),t[18](null)}}}function J(t,i,n){let{targetValue:s=0}=i,{duration:o=2e3}=i,{startValue:r=0}=i,{enabled:a=!0}=i,{easing:h=t=>t}=i,{threshold:l=.2}=i,{rootMargin:c="0px 0px -100px 0px"}=i,{triggerOnce:d=!1}=i,{className:u=""}=i,{style:g={}}=i;const f=e.createEventDispatcher();let p,m=null;return e.onMount(()=>{if(!p)return;n(17,m=new L(p,{targetValue:s,duration:o,startValue:r,enabled:a,easing:h,threshold:l,rootMargin:c,triggerOnce:d,onUpdate:t=>{f("update",t)},onComplete:()=>{f("complete")}}))}),e.onDestroy(()=>{m&&(m.destroy(),n(17,m=null))}),t.$$set=t=>{"targetValue"in t&&n(3,s=t.targetValue),"duration"in t&&n(4,o=t.duration),"startValue"in t&&n(5,r=t.startValue),"enabled"in t&&n(6,a=t.enabled),"easing"in t&&n(7,h=t.easing),"threshold"in t&&n(8,l=t.threshold),"rootMargin"in t&&n(9,c=t.rootMargin),"triggerOnce"in t&&n(10,d=t.triggerOnce),"className"in t&&n(0,u=t.className),"style"in t&&n(1,g=t.style)},t.$$.update=()=>{133112&t.$$.dirty&&m&&m.updateConfig({targetValue:s,duration:o,startValue:r,enabled:a,easing:h,threshold:l,rootMargin:c,triggerOnce:d,onUpdate:t=>{f("update",t)},onComplete:()=>{f("complete")}})},[u,g,p,s,o,r,a,h,l,c,d,function(){m&&m.start()},function(){m&&m.stop()},function(){m&&m.reset()},function(){return m?m.getValue():0},function(t){m&&m.updateConfig(t)},function(){m&&(m.destroy(),n(17,m=null))},m,function(t){x[t?"unshift":"push"](()=>{p=t,n(2,p)})}]}function K(t){let i;return{c(){i=g("div"),f(i,"class",t[1]),f(i,"style",t[2])},m(e,n){d(e,i,n),t[8](i)},p:n,i:n,o:n,d(e){e&&u(i),t[8](null)}}}function Q(t,i,n){let s,o;l(t,effect,t=>n(10,s=t)),l(t,props,t=>n(11,o=t));let{text:r,speed:a=50,delay:h=0,enabled:c=!0,threshold:d=.2,rootMargin:u="0px 0px -100px 0px",triggerOnce:g=!1,showCursor:f=!0,cursorChar:p="|",className:m="",style:y="",onUpdate:b,onComplete:v}=o(),M=null,$=null;return e.onMount(()=>{if(!M)return;$=new W(M,{text:r,speed:a,delay:h,enabled:c,threshold:d,rootMargin:u,triggerOnce:g,showCursor:f,cursorChar:p,onUpdate:b,onComplete:v})}),e.onDestroy(()=>{$&&($.destroy(),$=null)}),s(()=>{$&&r!==$.originalText&&$.setText(r)}),[M,m,y,function(){null==$||$.start()},function(){null==$||$.stop()},function(){null==$||$.reset()},function(t){null==$||$.setText(t)},function(){$&&($.destroy(),$=null)},function(t){x[t?"unshift":"push"](()=>{M=t,n(0,M)})}]}function Z(t){let i,e;const n=t[18].default,s=function(t,i,e,n){if(t){const s=c(t,i,e,n);return t[0](s)}}(n,t,t[17],null);return{c(){i=g("div"),s&&s.c(),f(i,"class",t[0]),f(i,"style",t[1])},m(n,o){d(n,i,o),s&&s.m(i,null),t[19](i),e=!0},p(t,[o]){var r,a;s&&s.p&&(!e||131072&o)&&function(t,i,e,n,s,o){if(s){const r=c(i,e,n,o);t.p(r,s)}}(s,n,t,t[17],e?(r=n,a=t[17],r[2],a.dirty):function(t){if(t.ctx.length>32){const i=[],e=t.ctx.length/32;for(let t=0;t<e;t++)i[t]=-1;return i}return-1}(t[17]),null),(!e||1&o)&&f(i,"class",t[0]),(!e||2&o)&&f(i,"style",t[1])},i(t){e||(D(s,t),e=!0)},o(t){!function(t,i){if(t&&t.o){if(R.has(t))return;R.add(t),(void 0).c.push(()=>{R.delete(t)}),t.o(i)}}(s,t),e=!1},d(e){e&&u(i),s&&s.d(e),t[19](null)}}}function tt(t,i,n){let{$$slots:s={},$$scope:o}=i,{direction:r="bottom"}=i,{distance:a="50px"}=i,{duration:h=800}=i,{threshold:l=.1}=i,{rootMargin:c="0px"}=i,{root:d=null}=i,{triggerOnce:u=!1}=i,{enabled:g=!0}=i,{className:f=""}=i,{style:p={}}=i;const m=e.createEventDispatcher();let y,b=null;return e.onMount(()=>{if(!y)return;n(16,b=new q(y,{direction:r,distance:a,duration:h,threshold:l,rootMargin:c,root:d,triggerOnce:u,enabled:g,onStart:()=>{m("start")},onComplete:()=>{m("complete")}}))}),e.onDestroy(()=>{b&&(b.destroy(),n(16,b=null))}),t.$$set=t=>{"direction"in t&&n(3,r=t.direction),"distance"in t&&n(4,a=t.distance),"duration"in t&&n(5,h=t.duration),"threshold"in t&&n(6,l=t.threshold),"rootMargin"in t&&n(7,c=t.rootMargin),"root"in t&&n(8,d=t.root),"triggerOnce"in t&&n(9,u=t.triggerOnce),"enabled"in t&&n(10,g=t.enabled),"className"in t&&n(0,f=t.className),"style"in t&&n(1,p=t.style),"$$scope"in t&&n(17,o=t.$$scope)},t.$$.update=()=>{67576&t.$$.dirty&&b&&b.updateConfig({direction:r,distance:a,duration:h,threshold:l,rootMargin:c,root:d,triggerOnce:u,enabled:g,onStart:()=>{m("start")},onComplete:()=>{m("complete")}})},[f,p,y,r,a,h,l,c,d,u,g,function(){b&&b.start()},function(){b&&b.stop()},function(){b&&b.reset()},function(t){b&&b.updateConfig(t)},function(){b&&(b.destroy(),n(16,b=null))},b,o,s,function(t){x[t?"unshift":"push"](()=>{y=t,n(2,y)})}]}function it(t){let i;return{c(){i=g("div"),f(i,"class",t[0]),f(i,"style",t[1])},m(e,n){d(e,i,n),t[21](i)},p(t,[e]){1&e&&f(i,"class",t[0]),2&e&&f(i,"style",t[1])},i:n,o:n,d(e){e&&u(i),t[21](null)}}}function et(t,i,n){let s,{text:o=""}=i,{delay:r=.2}=i,{duration:a=.6}=i,{randomDelay:h=2}=i,{threshold:l=.1}=i,{rootMargin:c="0px"}=i,{root:d=null}=i,{triggerOnce:u=!1}=i,{enabled:g=!0}=i,{className:f=""}=i,{style:p={}}=i,{onStart:m=null}=i,{onComplete:y=null}=i,b=null;return e.onMount(()=>{if(!s)return;n(20,b=new j(s,{text:o,delay:r,duration:a,randomDelay:h,threshold:l,rootMargin:c,root:d,triggerOnce:u,enabled:g,onStart:m||void 0,onComplete:y||void 0}))}),e.onDestroy(()=>{b&&(b.destroy(),n(20,b=null))}),t.$$set=t=>{"text"in t&&n(3,o=t.text),"delay"in t&&n(4,r=t.delay),"duration"in t&&n(5,a=t.duration),"randomDelay"in t&&n(6,h=t.randomDelay),"threshold"in t&&n(7,l=t.threshold),"rootMargin"in t&&n(8,c=t.rootMargin),"root"in t&&n(9,d=t.root),"triggerOnce"in t&&n(10,u=t.triggerOnce),"enabled"in t&&n(11,g=t.enabled),"className"in t&&n(0,f=t.className),"style"in t&&n(1,p=t.style),"onStart"in t&&n(12,m=t.onStart),"onComplete"in t&&n(13,y=t.onComplete)},t.$$.update=()=>{1064952&t.$$.dirty&&b&&b.updateConfig({text:o,delay:r,duration:a,randomDelay:h,threshold:l,rootMargin:c,root:d,triggerOnce:u,enabled:g,onStart:m||void 0,onComplete:y||void 0})},[f,p,s,o,r,a,h,l,c,d,u,g,m,y,function(){b&&b.start()},function(){b&&b.stop()},function(){b&&b.reset()},function(t){b&&b.updateText(t)},function(t){b&&b.updateConfig(t)},function(){b&&(b.destroy(),n(20,b=null))},b,function(t){x[t?"unshift":"push"](()=>{s=t,n(2,s)})}]}exports.Count=class extends H{constructor(t){super(),P(this,t,J,G,h,{targetValue:3,duration:4,startValue:5,enabled:6,easing:7,threshold:8,rootMargin:9,triggerOnce:10,className:0,style:1,start:11,stop:12,reset:13,getValue:14,updateConfig:15,destroy:16})}get start(){return this.$$.ctx[11]}get stop(){return this.$$.ctx[12]}get reset(){return this.$$.ctx[13]}get getValue(){return this.$$.ctx[14]}get updateConfig(){return this.$$.ctx[15]}get destroy(){return this.$$.ctx[16]}},exports.MasonEffect=X,exports.ScrollFadeIn=class extends H{constructor(t){super(),P(this,t,tt,Z,h,{direction:3,distance:4,duration:5,threshold:6,rootMargin:7,root:8,triggerOnce:9,enabled:10,className:0,style:1,start:11,stop:12,reset:13,updateConfig:14,destroy:15})}get start(){return this.$$.ctx[11]}get stop(){return this.$$.ctx[12]}get reset(){return this.$$.ctx[13]}get updateConfig(){return this.$$.ctx[14]}get destroy(){return this.$$.ctx[15]}},exports.TextSpin=class extends H{constructor(t){super(),P(this,t,et,it,h,{text:3,delay:4,duration:5,randomDelay:6,threshold:7,rootMargin:8,root:9,triggerOnce:10,enabled:11,className:0,style:1,onStart:12,onComplete:13,start:14,stop:15,reset:16,updateText:17,updateConfig:18,destroy:19})}get start(){return this.$$.ctx[14]}get stop(){return this.$$.ctx[15]}get reset(){return this.$$.ctx[16]}get updateText(){return this.$$.ctx[17]}get updateConfig(){return this.$$.ctx[18]}get destroy(){return this.$$.ctx[19]}},exports.TextToParticle=X,exports.Typing=class extends H{constructor(t){super(),P(this,t,Q,K,h,{start:3,stop:4,reset:5,setText:6,destroy:7})}get start(){return this.$$.ctx[3]}get stop(){return this.$$.ctx[4]}get reset(){return this.$$.ctx[5]}get setText(){return this.$$.ctx[6]}get destroy(){return this.$$.ctx[7]}},exports.default=X;
1
+ "use strict";var t=Object.defineProperty,e=(e,i,n)=>((e,i,n)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[i]=n)(e,"symbol"!=typeof i?i+"":i,n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("svelte");function n(){}function s(t){return t()}function o(){return Object.create(null)}function r(t){t.forEach(s)}function a(t){return"function"==typeof t}function h(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function l(t,e,i){t.$$.on_destroy.push(function(t,...e){if(null==t){for(const t of e)t(void 0);return n}const i=t.subscribe(...e);return i.unsubscribe?()=>i.unsubscribe():i}(e,i))}function c(t,e,i,n){return t[1]&&n?function(t,e){for(const i in e)t[i]=e[i];return t}(i.ctx.slice(),t[1](n(e))):i.ctx}function d(t,e,i){t.insertBefore(e,i||null)}function u(t){t.parentNode&&t.parentNode.removeChild(t)}function g(t){return document.createElement(t)}function f(t,e,i){null==i?t.removeAttribute(e):t.getAttribute(e)!==i&&t.setAttribute(e,i)}let p;function m(t){p=t}const y=[],x=[];let b=[];const v=[],M=Promise.resolve();let $=!1;function C(t){b.push(t)}const w=new Set;let T=0;function S(){if(0!==T)return;const t=p;do{try{for(;T<y.length;){const t=y[T];T++,m(t),V(t.$$)}}catch(e){throw y.length=0,T=0,e}for(m(null),y.length=0,T=0;x.length;)x.pop()();for(let t=0;t<b.length;t+=1){const e=b[t];w.has(e)||(w.add(e),e())}b.length=0}while(y.length);for(;v.length;)v.pop()();$=!1,w.clear(),m(t)}function V(t){if(null!==t.fragment){t.update(),r(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(C)}}const R=new Set;function D(t,e){t&&t.i&&(R.delete(t),t.i(e))}function O(t,e){const i=t.$$;null!==i.fragment&&(!function(t){const e=[],i=[];b.forEach(n=>-1===t.indexOf(n)?e.push(n):i.push(n)),i.forEach(t=>t()),b=e}(i.after_update),r(i.on_destroy),i.fragment&&i.fragment.d(e),i.on_destroy=i.fragment=null,i.ctx=[])}function E(t,e){-1===t.$$.dirty[0]&&(y.push(t),$||($=!0,M.then(S)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function P(t,e,i,h,l,c,d=null,g=[-1]){const f=p;m(t);const y=t.$$={fragment:null,ctx:[],props:c,update:n,not_equal:l,bound:o(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(f?f.$$.context:[])),callbacks:o(),dirty:g,skip_bound:!1,root:e.target||f.$$.root};d&&d(y.root);let x=!1;if(y.ctx=i?i(t,e.props||{},(e,i,...n)=>{const s=n.length?n[0]:i;return y.ctx&&l(y.ctx[e],y.ctx[e]=s)&&(!y.skip_bound&&y.bound[e]&&y.bound[e](s),x&&E(t,e)),i}):[],y.update(),x=!0,r(y.before_update),y.fragment=!!h&&h(y.ctx),e.target){if(e.hydrate){const t=(b=e.target,Array.from(b.childNodes));y.fragment&&y.fragment.l(t),t.forEach(u)}else y.fragment&&y.fragment.c();e.intro&&D(t.$$.fragment),function(t,e,i){const{fragment:n,after_update:o}=t.$$;n&&n.m(e,i),C(()=>{const e=t.$$.on_mount.map(s).filter(a);t.$$.on_destroy?t.$$.on_destroy.push(...e):r(e),t.$$.on_mount=[]}),o.forEach(C)}(t,e.target,e.anchor),S()}var b;m(f)}class I{constructor(){e(this,"$$"),e(this,"$$set")}$destroy(){O(this,1),this.$destroy=n}$on(t,e){if(!a(e))return n;const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(e),()=>{const t=i.indexOf(e);-1!==t&&i.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}"undefined"!=typeof window&&(window.__svelte||(window.__svelte={v:new Set})).v.add("4");class H{constructor(t,e={}){this.container=t,this.options={threshold:e.threshold??.1,rootMargin:e.rootMargin??"0px",root:e.root??null,onVisible:e.onVisible,onHidden:e.onHidden},this.intersectionObserver=null,this.visibilityChangeHandler=null,this.isVisible=!1,this.isPageVisible="undefined"==typeof document||!document.hidden,this.setupIntersectionObserver(),this.setupPageVisibility()}setupIntersectionObserver(){if("undefined"==typeof window||void 0===window.IntersectionObserver)return this.isVisible=!0,void(this.isPageVisible&&this.options.onVisible&&this.options.onVisible());this.intersectionObserver=new IntersectionObserver(t=>{for(const e of t)e.target===this.container&&(e.isIntersecting?(this.isVisible=!0,this.isPageVisible&&this.options.onVisible&&this.options.onVisible()):(this.isVisible=!1,this.options.onHidden&&this.options.onHidden()))},{threshold:this.options.threshold,rootMargin:this.options.rootMargin,root:this.options.root||null}),this.intersectionObserver.observe(this.container)}setupPageVisibility(){"undefined"!=typeof document&&(this.visibilityChangeHandler=()=>{const t=this.isPageVisible;this.isPageVisible=!document.hidden,document.hidden?this.options.onHidden&&this.options.onHidden():t!==this.isPageVisible&&this.isVisible&&this.options.onVisible&&this.options.onVisible()},document.addEventListener("visibilitychange",this.visibilityChangeHandler),document.hidden&&this.isVisible&&this.options.onHidden&&this.options.onHidden())}getIsVisible(){return this.isVisible&&this.isPageVisible}updateOptions(t){this.options={...this.options,...t},this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.setupIntersectionObserver()}destroy(){this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.visibilityChangeHandler&&"undefined"!=typeof document&&(document.removeEventListener("visibilitychange",this.visibilityChangeHandler),this.visibilityChangeHandler=null)}}function F(t,e){let i=null;return function(...n){null!==i&&clearTimeout(i),i=setTimeout(()=>{i=null,t.apply(this,n)},e)}}class U{constructor(t,e={}){if(this.container="string"==typeof t?document.querySelector(t):t,!this.container)throw new Error("Container element not found");this.config={text:e.text||"mason effect",densityStep:e.densityStep??2,maxParticles:e.maxParticles??3200,pointSize:e.pointSize??.5,ease:e.ease??.05,repelRadius:e.repelRadius??150,repelStrength:e.repelStrength??1,particleColor:e.particleColor||"#fff",fontFamily:e.fontFamily||"Inter, system-ui, Arial",fontSize:e.fontSize||null,width:e.width||null,height:e.height||null,devicePixelRatio:e.devicePixelRatio??null,onReady:e.onReady||null,onUpdate:e.onUpdate||null},this.canvas=document.createElement("canvas");const i=this.canvas.getContext("2d",{willReadFrequently:!0});if(!i)throw new Error("Canvas context not available");this.ctx=i,this.container.appendChild(this.canvas),this.canvas.style.display="block",this.offCanvas=document.createElement("canvas");const n=this.offCanvas.getContext("2d",{willReadFrequently:!0});if(!n)throw new Error("Offscreen canvas context not available");this.offCtx=n,this.W=0,this.H=0,this.DPR=this.config.devicePixelRatio||Math.min(window.devicePixelRatio||1,1.8),this.particles=[],this.mouse={x:0,y:0,down:!1},this.animationId=null,this.isRunning=!1,this.visibilityManager=null,this.debounceDelay=e.debounceDelay??150;const s=this.handleResize.bind(this);this.handleResize=F(s,this.debounceDelay),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this._debouncedMorph=F(this._morphInternal.bind(this),this.debounceDelay),this._debouncedUpdateConfig=F(this._updateConfigInternal.bind(this),this.debounceDelay),this.init()}init(){this.resize(),this.setupEventListeners(),this.setupVisibilityManager(),this.config.onReady&&this.config.onReady(this)}setupVisibilityManager(){this.visibilityManager=new H(this.container,{threshold:.1,onVisible:()=>{this.start()},onHidden:()=>{this.stop()}})}resize(){const t=this.container.getBoundingClientRect(),e=this.config.width||t.width||this.container.clientWidth||window.innerWidth,i=this.config.height||t.height||this.container.clientHeight||.7*window.innerHeight;if(e<=0||i<=0)return;this.W=Math.floor(e*this.DPR),this.H=Math.floor(i*this.DPR);const n=4096;if(this.W>n||this.H>n){const t=Math.min(n/this.W,n/this.H);this.W=Math.floor(this.W*t),this.H=Math.floor(this.H*t),this.DPR=this.DPR*t}this.canvas.width=this.W,this.canvas.height=this.H,this.canvas.style.width=e+"px",this.canvas.style.height=i+"px",this.W>0&&this.H>0&&(this.buildTargets(),this.particles.length||this.initParticles())}measureTextFit(t,e,i,n){this.offCtx.font=`400 ${t}px ${this.config.fontFamily}`;const s=e.split("\n"),o=t,r=.1*t,a=.05*t;let h=0;for(const c of s){if(0===c.length)continue;const t=this.offCtx.measureText(c).width+a*(c.length>0?c.length-1:0);h=Math.max(h,t)}const l=s.length>0?o*s.length+r*(s.length-1):o;return{width:h,height:l,fits:h<=i&&l<=n}}findOptimalFontSize(t,e,i,n){if(this.measureTextFit(n,t,e,i).fits)return n;if(n<=12)return 12;let s=12,o=n,r=12;for(;s<=o;){const n=Math.floor((s+o)/2);this.measureTextFit(n,t,e,i).fits?(r=n,s=n+1):o=n-1}return r}buildTargets(){if(this.W<=0||this.H<=0)return;const t=this.config.text;this.offCanvas.width=this.W,this.offCanvas.height=this.H,this.offCtx.clearRect(0,0,this.offCanvas.width,this.offCanvas.height);const e=Math.min(this.W,this.H),i=this.config.fontSize||Math.max(80,Math.floor(.18*e)),n=this.W-80,s=this.H-80,o=this.findOptimalFontSize(t,n,s,i);this.offCtx.fillStyle="#ffffff",this.offCtx.textAlign="center",this.offCtx.textBaseline="middle",this.offCtx.font=`400 ${o}px ${this.config.fontFamily}`;const r=t.split("\n"),a=o,h=.1*o,l=.05*o,c=r.length>0?a*r.length+h*(r.length-1):a;let d=this.H/2-c/2+a/2;for(const p of r){if(0===p.length){d+=a+h;continue}const t=p.split(""),e=this.offCtx.measureText(p).width+l*(t.length>0?t.length-1:0);let i=this.W/2-e/2;for(const n of t)this.offCtx.fillText(n,i+this.offCtx.measureText(n).width/2,d),i+=this.offCtx.measureText(n).width+l;d+=a+h}const u=Math.max(2,this.config.densityStep),g=this.offCtx.getImageData(0,0,this.W,this.H).data,f=[];for(let p=0;p<this.H;p+=u)for(let t=0;t<this.W;t+=u){const e=4*(p*this.W+t);g[e]+g[e+1]+g[e+2]>600&&f.push({x:t,y:p})}for(;f.length>this.config.maxParticles;)f.splice(Math.floor(Math.random()*f.length),1);if(this.particles.length<f.length){const t=f.length-this.particles.length;for(let e=0;e<t;e++)this.particles.push(this.makeParticle())}else this.particles.length>f.length&&(this.particles.length=f.length);for(let p=0;p<this.particles.length;p++){const t=this.particles[p],e=f[p];t.tx=e.x,t.ty=e.y}}makeParticle(){const t=Math.random()*this.W,e=Math.random()*this.H;return{x:t,y:e,vx:0,vy:0,tx:t,ty:e,initialX:t,initialY:e,j:Math.random()*Math.PI*2}}initParticles(){for(const t of this.particles){const e=Math.random()*this.W,i=Math.random()*this.H;t.x=e,t.y=i,t.vx=t.vy=0,t.initialX=e,t.initialY=i}}scatter(){for(const t of this.particles)void 0!==t.initialX&&void 0!==t.initialY?(t.tx=t.initialX,t.ty=t.initialY):(t.initialX=t.x,t.initialY=t.y,t.tx=t.initialX,t.ty=t.initialY)}morph(t){this._debouncedMorph(t)}_morphInternal(t){if(0!==this.W&&0!==this.H||this.resize(),"string"==typeof t)this.config.text=t,this.buildTargets();else if(t&&"object"==typeof t){const e=void 0!==t.text;this.config={...this.config,...t},e&&this.buildTargets()}else this.buildTargets()}update(){this.ctx.clearRect(0,0,this.W,this.H);for(const n of this.particles){let t=(n.tx-n.x)*this.config.ease,e=(n.ty-n.y)*this.config.ease;if(this.mouse.x||this.mouse.y){const i=n.x-this.mouse.x,s=n.y-this.mouse.y,o=i*i+s*s,r=this.config.repelRadius*this.DPR;if(o<r*r){const n=Math.sqrt(o)+1e-4,a=(this.mouse.down?-1:1)*this.config.repelStrength*(1-n/r);t+=i/n*a*6,e+=s/n*a*6}}n.j+=2,t+=.05*Math.cos(n.j),e+=.05*Math.sin(1.3*n.j),n.vx=(n.vx+t)*Math.random(),n.vy=(n.vy+e)*Math.random(),n.x+=n.vx,n.y+=n.vy}this.ctx.fillStyle=this.config.particleColor;const t=Math.min(this.W,this.H)/this.DPR,e=Math.max(.5,Math.min(2,t/1920)),i=this.config.pointSize*this.DPR*e;for(const n of this.particles)this.ctx.beginPath(),this.ctx.arc(n.x,n.y,i,0,2*Math.PI),this.ctx.fill();this.config.onUpdate&&this.config.onUpdate(this)}animate(){this.isRunning&&(this.update(),this.animationId=requestAnimationFrame(()=>this.animate()))}start(){this.isRunning||(this.isRunning=!0,this.animate())}stop(){this.isRunning=!1,this.animationId&&(cancelAnimationFrame(this.animationId),this.animationId=null)}setupEventListeners(){window.addEventListener("resize",this.handleResize),this.canvas.addEventListener("mousemove",this.handleMouseMove),this.canvas.addEventListener("mouseleave",this.handleMouseLeave),this.canvas.addEventListener("mousedown",this.handleMouseDown),window.addEventListener("mouseup",this.handleMouseUp)}removeEventListeners(){window.removeEventListener("resize",this.handleResize),this.canvas.removeEventListener("mousemove",this.handleMouseMove),this.canvas.removeEventListener("mouseleave",this.handleMouseLeave),this.canvas.removeEventListener("mousedown",this.handleMouseDown),window.removeEventListener("mouseup",this.handleMouseUp)}handleResize(){this.resize()}handleMouseMove(t){const e=this.canvas.getBoundingClientRect();this.mouse.x=(t.clientX-e.left)*this.DPR,this.mouse.y=(t.clientY-e.top)*this.DPR}handleMouseLeave(){this.mouse.x=this.mouse.y=0}handleMouseDown(){this.mouse.down=!0}handleMouseUp(){this.mouse.down=!1}updateConfig(t){this._debouncedUpdateConfig(t)}_updateConfigInternal(t){this.config={...this.config,...t},t.text&&this.buildTargets()}destroy(){this.stop(),this.removeEventListeners(),this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null),this.canvas&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)}}const _={linear:t=>t};class L{constructor(t,e){if(this.container="string"==typeof t?document.querySelector(t):t,!this.container)throw new Error("Container element not found");this.config={targetValue:e.targetValue,duration:e.duration??2e3,startValue:e.startValue??0,enabled:e.enabled??!0,easing:e.easing??_.linear,threshold:e.threshold??.2,rootMargin:e.rootMargin??"0px 0px -100px 0px",triggerOnce:e.triggerOnce??!1,onUpdate:e.onUpdate||null,onComplete:e.onComplete||null},this.currentValue=this.config.startValue,this.startTime=null,this.animationFrameId=null,this.visibilityManager=null,this.isRunning=!1,this.hasTriggered=!1,this.init()}init(){this.updateDisplay(this.config.startValue),this.setupVisibilityManager()}setupVisibilityManager(){this.visibilityManager=new H(this.container,{threshold:this.config.threshold,rootMargin:this.config.rootMargin,onVisible:()=>{!this.hasTriggered&&this.config.enabled&&(this.hasTriggered=!0,this.start())},onHidden:()=>{!this.config.triggerOnce&&this.isRunning&&this.reset()}})}start(){if(this.isRunning)return;if(!this.config.enabled)return;this.isRunning=!0,this.startTime=null,this.currentValue=this.config.startValue,this.updateDisplay(this.currentValue);const t=e=>{null===this.startTime&&(this.startTime=e);const i=e-this.startTime,n=Math.min(i/this.config.duration,1),s=this.config.easing(n);this.currentValue=Math.floor(this.config.startValue+(this.config.targetValue-this.config.startValue)*s),this.updateDisplay(this.currentValue),this.config.onUpdate&&this.config.onUpdate(this.currentValue),n<1?this.animationFrameId=requestAnimationFrame(t):(this.currentValue=this.config.targetValue,this.updateDisplay(this.currentValue),this.isRunning=!1,this.config.onComplete&&this.config.onComplete())};this.animationFrameId=requestAnimationFrame(t)}stop(){this.isRunning=!1,null!==this.animationFrameId&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null)}reset(){this.stop(),this.currentValue=this.config.startValue,this.updateDisplay(this.currentValue),this.hasTriggered=!1,this.startTime=null}updateDisplay(t){this.container.textContent=this.formatNumber(t)}formatNumber(t){return Math.floor(t).toLocaleString()}updateConfig(t){const e=this.isRunning;this.stop(),this.config={...this.config,...t,onUpdate:void 0!==t.onUpdate?t.onUpdate:this.config.onUpdate,onComplete:void 0!==t.onComplete?t.onComplete:this.config.onComplete},void 0!==t.targetValue?(this.reset(),e&&this.config.enabled&&this.start()):e&&this.config.enabled&&this.start()}getValue(){return this.currentValue}destroy(){this.stop(),this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null)}}function z(t){const e=t.charCodeAt(0);if(e<44032||e>55203)return[t];const i=e-44032,n=Math.floor(i/588),s=Math.floor(i%588/28),o=i%28,r=["","ㄱ","ㄲ","ㄳ","ㄴ","ㄵ","ㄶ","ㄷ","ㄹ","ㄺ","ㄻ","ㄼ","ㄽ","ㄾ","ㄿ","ㅀ","ㅁ","ㅂ","ㅄ","ㅅ","ㅆ","ㅇ","ㅈ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ"],a=[];return a.push(["ㄱ","ㄲ","ㄴ","ㄷ","ㄸ","ㄹ","ㅁ","ㅂ","ㅃ","ㅅ","ㅆ","ㅇ","ㅈ","ㅉ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ"][n]),a.push(["ㅏ","ㅐ","ㅑ","ㅒ","ㅓ","ㅔ","ㅕ","ㅖ","ㅗ","ㅘ","ㅙ","ㅚ","ㅛ","ㅜ","ㅝ","ㅞ","ㅟ","ㅠ","ㅡ","ㅢ","ㅣ"][s]),o>0&&a.push(r[o]),a}function N(t,e,i){const n=["ㄱ","ㄲ","ㄴ","ㄷ","ㄸ","ㄹ","ㅁ","ㅂ","ㅃ","ㅅ","ㅆ","ㅇ","ㅈ","ㅉ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ"].indexOf(t),s=["ㅏ","ㅐ","ㅑ","ㅒ","ㅓ","ㅔ","ㅕ","ㅖ","ㅗ","ㅘ","ㅙ","ㅚ","ㅛ","ㅜ","ㅝ","ㅞ","ㅟ","ㅠ","ㅡ","ㅢ","ㅣ"].indexOf(e),o=i?["","ㄱ","ㄲ","ㄳ","ㄴ","ㄵ","ㄶ","ㄷ","ㄹ","ㄺ","ㄻ","ㄼ","ㄽ","ㄾ","ㄿ","ㅀ","ㅁ","ㅂ","ㅄ","ㅅ","ㅆ","ㅇ","ㅈ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ"].indexOf(i):0;if(-1===n||-1===s)return t+(e||"")+(i||"");const r=44032+21*n*28+28*s+o;return String.fromCharCode(r)}function A(t){const e=[],i=[];for(let n=0;n<t.length;n++){const s=t[n],o=s.charCodeAt(0),r=e.length;if(o>=44032&&o<=55203){const t=z(s);e.push(...t),i.push({start:r,end:e.length,isHangul:!0})}else e.push(s),i.push({start:r,end:e.length,isHangul:!1})}return{units:e,charUnitRanges:i}}class W{constructor(t,e){if(this.container="string"==typeof t?document.querySelector(t):t,!this.container)throw new Error("Container element not found");this.originalText=e.text,this.config={text:e.text,speed:e.speed??50,delay:e.delay??0,enabled:e.enabled??!0,threshold:e.threshold??.2,rootMargin:e.rootMargin??"0px 0px -100px 0px",triggerOnce:e.triggerOnce??!1,showCursor:e.showCursor??!0,cursorChar:e.cursorChar??"|",onUpdate:e.onUpdate||null,onComplete:e.onComplete||null};const i=A(this.config.text);this.textUnits=i.units,this.charUnitRanges=i.charUnitRanges,this.currentIndex=0,this.displayedText="",this.timeoutId=null,this.visibilityManager=null,this.isRunning=!1,this.hasTriggered=!1,this.init()}init(){this.updateDisplay(""),this.injectStyles(),this.setupVisibilityManager()}injectStyles(){if(document.getElementById("masoneffect-typing-styles"))return;const t=document.createElement("style");t.id="masoneffect-typing-styles",t.textContent="\n .typing-char {\n transition: opacity 0.3s ease-in;\n display: inline-block;\n }\n .typing-cursor {\n display: inline-block;\n }\n ",document.head.appendChild(t),this.container.style.whiteSpace="pre-wrap"}setupVisibilityManager(){this.visibilityManager=new H(this.container,{threshold:this.config.threshold,rootMargin:this.config.rootMargin,onVisible:()=>{!this.hasTriggered&&this.config.enabled&&(this.hasTriggered=!0,setTimeout(()=>this.start(),this.config.delay))},onHidden:()=>{}})}buildTextFromUnits(t){if(0===t)return"";let e="";for(let i=0;i<this.charUnitRanges.length;i++){const n=this.charUnitRanges[i];if(n.start>=t)break;const s=Math.min(t-n.start,n.end-n.start);if(s<=0)break;if(n.isHangul){const t=this.textUnits.slice(n.start,n.start+s);1===t.length?e+=t[0]:2===t.length?e+=N(t[0],t[1]):t.length>=3&&(e+=N(t[0],t[1],t[2]))}else s>0&&(e+=this.textUnits[n.start])}return e}start(){this.isRunning||(this.isRunning=!0,this.currentIndex=0,this.displayedText="",this.typeNext())}typeNext(){if(this.currentIndex>=this.textUnits.length)return this.isRunning=!1,this.config.showCursor&&this.updateDisplay(this.originalText),void(this.config.onComplete&&this.config.onComplete());this.displayedText=this.buildTextFromUnits(this.currentIndex+1);let t=this.displayedText;this.config.showCursor&&(t+=this.config.cursorChar),this.updateDisplay(t),this.config.onUpdate&&this.config.onUpdate(this.displayedText),this.currentIndex++,this.timeoutId=setTimeout(()=>{this.typeNext()},this.config.speed)}stop(){this.isRunning=!1,this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}reset(){this.stop(),this.currentIndex=0,this.displayedText="",this.hasTriggered=!1,this.updateDisplay("")}updateDisplay(t){const e=t.replace(new RegExp(this.escapeHtml(this.config.cursorChar)+"$"),""),i=t.endsWith(this.config.cursorChar),n=(this.container.textContent||"").replace(new RegExp(this.config.cursorChar+"$"),"");let s="";for(let r=0;r<e.length;r++){const t=e[r],i=r>=n.length,o=" "===t?"&nbsp;":this.escapeHtml(t);s+=i?`<span class="typing-char typing-fade-in" style="opacity: 0;">${o}</span>`:`<span class="typing-char" style="opacity: 1;">${o}</span>`}i&&(s+=`<span class="typing-cursor">${this.escapeHtml(this.config.cursorChar)}</span>`),this.container.innerHTML=s;const o=this.container.querySelectorAll(".typing-fade-in");o.length>0&&requestAnimationFrame(()=>{o.forEach(t=>{t.style.opacity="1",t.classList.remove("typing-fade-in")})})}escapeHtml(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}setText(t){this.originalText=t,this.config.text=t;const e=A(t);this.textUnits=e.units,this.charUnitRanges=e.charUnitRanges,this.reset(),this.config.enabled&&setTimeout(()=>this.start(),this.config.delay)}destroy(){this.stop(),this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null)}}const k=t=>--t*t*t+1;class q{constructor(t,e={}){if(this.container="string"==typeof t?document.querySelector(t):t,!this.container)throw new Error("Container element not found");this.config={direction:e.direction??"bottom",distance:e.distance??"50px",duration:e.duration??800,threshold:e.threshold??.1,rootMargin:e.rootMargin??"0px",root:e.root??null,triggerOnce:e.triggerOnce??!1,enabled:e.enabled??!0,onStart:e.onStart||null,onComplete:e.onComplete||null},this.easing=k,this.visibilityManager=null,this.animationFrameId=null,this.startTime=null,this.isRunning=!1,this.hasTriggered=!1,this.initialTransform="",this.targetDistance=0,this.init()}init(){const t=window.getComputedStyle(this.container);this.initialTransform="none"!==t.transform?t.transform:this.container.style.transform||"",this.targetDistance=this.parseDistance(this.config.distance),this.setInitialPosition(),this.setupVisibilityManager()}parseDistance(t){const e=t.match(/^(-?\d+\.?\d*)(px|rem|em|%|vh|vw)$/);if(!e){return parseFloat(t)||50}const i=parseFloat(e[1]);switch(e[2]){case"px":default:return i;case"rem":case"em":return i*(parseFloat(getComputedStyle(document.documentElement).fontSize)||16);case"%":const t=this.container.getBoundingClientRect();return i/100*("top"===this.config.direction||"bottom"===this.config.direction?t.height:t.width);case"vh":return i/100*window.innerHeight;case"vw":return i/100*window.innerWidth}}setInitialPosition(){let t=0,e=0;switch(this.config.direction){case"top":e=-this.targetDistance;break;case"right":t=this.targetDistance;break;case"bottom":e=this.targetDistance;break;case"left":t=-this.targetDistance}const i=this.initialTransform||"",n=`translate(${t}px, ${e}px)`;this.container.style.transform=i&&"none"!==i?`${n} ${i}`:n,this.container.style.opacity="0",this.container.style.transition="none"}setupVisibilityManager(){this.visibilityManager=new H(this.container,{threshold:this.config.threshold,rootMargin:this.config.rootMargin,root:this.config.root,onVisible:()=>{this.config.enabled&&(this.config.triggerOnce&&this.hasTriggered||(this.hasTriggered=!0,this.start()))},onHidden:()=>{this.config.enabled&&(this.stop(),this.config.triggerOnce||(this.hasTriggered=!1),this.setInitialPosition())}})}start(){this.isRunning||(this.isRunning=!0,this.startTime=performance.now(),this.config.onStart&&this.config.onStart(),this.container.style.transition="none",this.animate())}animate(){if(!this.isRunning)return;const t=performance.now()-(this.startTime||0),e=Math.min(t/this.config.duration,1),i=this.easing(e);let n=0,s=0;switch(this.config.direction){case"top":s=-this.targetDistance*(1-i);break;case"right":n=this.targetDistance*(1-i);break;case"bottom":s=this.targetDistance*(1-i);break;case"left":n=-this.targetDistance*(1-i)}const o=this.initialTransform||"",r=`translate(${n}px, ${s}px)`;this.container.style.transform=o&&"none"!==o?`${r} ${o}`:r,this.container.style.opacity=String(i),e<1?this.animationFrameId=requestAnimationFrame(()=>this.animate()):this.complete()}complete(){this.isRunning=!1,this.initialTransform&&"none"!==this.initialTransform?this.container.style.transform=this.initialTransform:this.container.style.transform="",this.container.style.opacity="1",this.animationFrameId&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null),this.config.onComplete&&this.config.onComplete()}reset(){this.stop(),this.hasTriggered=!1,this.setInitialPosition()}stop(){this.isRunning=!1,this.animationFrameId&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null)}updateConfig(t){const e=this.isRunning;this.stop(),this.config={...this.config,...t,onStart:t.onStart??this.config.onStart,onComplete:t.onComplete??this.config.onComplete},t.distance&&(this.targetDistance=this.parseDistance(this.config.distance)),this.setInitialPosition(),void 0===t.threshold&&void 0===t.rootMargin&&void 0===t.root||(this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null),this.setupVisibilityManager()),e&&this.config.enabled&&this.start()}destroy(){this.stop(),this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null),this.container.style.transform=this.initialTransform||"",this.container.style.opacity="",this.container.style.transition=""}}class j{constructor(t,e){if(this.container="string"==typeof t?document.querySelector(t):t,!this.container)throw new Error("Container element not found");if(!e.text)throw new Error("Text is required");this.config={text:e.text,delay:e.delay??.2,duration:e.duration??.6,randomDelay:e.randomDelay??2,threshold:e.threshold??.1,rootMargin:e.rootMargin??"0px",root:e.root??null,triggerOnce:e.triggerOnce??!1,enabled:e.enabled??!0,onStart:e.onStart||null,onComplete:e.onComplete||null},this.visibilityManager=null,this.textElements=[],this.randomPoints=[],this.hasTriggered=!1,this.isActive=!1,this.init()}init(){this.injectStyles(),this.createTextStructure(),this.setupVisibilityManager()}injectStyles(){if(document.getElementById("masoneffect-textspin-styles"))return;const t=document.createElement("style");t.id="masoneffect-textspin-styles",t.textContent="\n .masoneffect-textspin {\n display: inline-block;\n }\n .masoneffect-textspin-char {\n display: inline-block;\n opacity: 0;\n transform: rotateY(90deg);\n }\n .masoneffect-textspin-char.active {\n opacity: 1;\n transform: rotateY(0deg);\n }\n .masoneffect-textspin-char.space {\n width: 0.25em;\n }\n ",document.head.appendChild(t)}createTextStructure(){this.container.innerHTML="",this.textElements=[],this.randomPoints=[];const t=this.config.text.split("");t.forEach(()=>{this.randomPoints.push(Math.random())}),t.forEach((t,e)=>{const i=document.createElement("span");i.className="masoneffect-textspin-char",i.style.transition=`opacity ${this.config.duration}s ease-out, transform ${this.config.duration}s ease-out`," "===t?(i.classList.add("space"),i.innerHTML="&nbsp;"):i.textContent=t,this.container.appendChild(i),this.textElements.push(i)}),this.container.classList.add("masoneffect-textspin")}setupVisibilityManager(){this.visibilityManager=new H(this.container,{threshold:this.config.threshold,rootMargin:this.config.rootMargin,root:this.config.root,onVisible:()=>{this.config.enabled&&(this.config.triggerOnce&&this.hasTriggered||(this.hasTriggered=!0,this.start()))},onHidden:()=>{this.config.enabled&&(this.stop(),this.config.triggerOnce||(this.hasTriggered=!1))}})}start(){if(this.isActive)return;this.isActive=!0,this.config.onStart&&this.config.onStart(),this.textElements.forEach((t,e)=>{const i=this.config.delay+this.randomPoints[e]*this.config.randomDelay;t.style.transitionDelay=`${i}s`,requestAnimationFrame(()=>{t.classList.add("active")})});const t=this.config.delay+this.config.randomDelay+this.config.duration;setTimeout(()=>{this.config.onComplete&&this.config.onComplete()},1e3*t)}stop(){this.isActive&&(this.isActive=!1,this.textElements.forEach(t=>{t.classList.remove("active"),t.style.transitionDelay=""}))}reset(){this.stop(),this.hasTriggered=!1}updateText(t){this.config.text=t,this.createTextStructure(),this.isActive&&this.start()}updateTransitions(){this.textElements.forEach(t=>{t.style.transition=`opacity ${this.config.duration}s ease-out, transform ${this.config.duration}s ease-out`})}updateConfig(t){var e;const i=this.isActive;this.config.enabled;const n=void 0!==t.enabled&&t.enabled!==this.config.enabled;(n&&!1===t.enabled||i)&&this.stop(),this.config={...this.config,...t,text:t.text??this.config.text,onStart:t.onStart??this.config.onStart,onComplete:t.onComplete??this.config.onComplete},void 0!==t.text?this.createTextStructure():void 0!==t.duration&&this.updateTransitions(),void 0===t.threshold&&void 0===t.rootMargin&&void 0===t.root||(this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null),this.setupVisibilityManager()),this.config.enabled&&(i||n&&!0===t.enabled)&&(null==(e=this.visibilityManager)?void 0:e.getIsVisible())&&this.start()}destroy(){this.stop(),this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null),this.container.innerHTML="",this.container.classList.remove("masoneffect-textspin")}}function Y(t){let e;return{c(){e=g("div"),f(e,"class",t[0]),f(e,"style",t[1])},m(i,n){d(i,e,n),t[21](e)},p(t,[i]){1&i&&f(e,"class",t[0]),2&i&&f(e,"style",t[1])},i:n,o:n,d(i){i&&u(e),t[21](null)}}}function B(t,e,n){let{text:s="mason effect"}=e,{densityStep:o=2}=e,{maxParticles:r=3200}=e,{pointSize:a=.5}=e,{ease:h=.05}=e,{repelRadius:l=150}=e,{repelStrength:c=1}=e,{particleColor:d="#fff"}=e,{fontFamily:u="Inter, system-ui, Arial"}=e,{fontSize:g=null}=e,{width:f=null}=e,{height:p=null}=e,{devicePixelRatio:m=null}=e,{className:y=""}=e,{style:b={}}=e;const v=i.createEventDispatcher();let M,$=null;return i.onMount(()=>{if(!M)return;n(20,$=new U(M,{text:s,densityStep:o,maxParticles:r,pointSize:a,ease:h,repelRadius:l,repelStrength:c,particleColor:d,fontFamily:u,fontSize:g,width:f,height:p,devicePixelRatio:m,onReady:t=>{v("ready",t)},onUpdate:t=>{v("update",t)}}))}),i.onDestroy(()=>{$&&($.destroy(),n(20,$=null))}),t.$$set=t=>{"text"in t&&n(3,s=t.text),"densityStep"in t&&n(4,o=t.densityStep),"maxParticles"in t&&n(5,r=t.maxParticles),"pointSize"in t&&n(6,a=t.pointSize),"ease"in t&&n(7,h=t.ease),"repelRadius"in t&&n(8,l=t.repelRadius),"repelStrength"in t&&n(9,c=t.repelStrength),"particleColor"in t&&n(10,d=t.particleColor),"fontFamily"in t&&n(11,u=t.fontFamily),"fontSize"in t&&n(12,g=t.fontSize),"width"in t&&n(13,f=t.width),"height"in t&&n(14,p=t.height),"devicePixelRatio"in t&&n(15,m=t.devicePixelRatio),"className"in t&&n(0,y=t.className),"style"in t&&n(1,b=t.style)},t.$$.update=()=>{1114104&t.$$.dirty&&$&&$.updateConfig({text:s,densityStep:o,maxParticles:r,pointSize:a,ease:h,repelRadius:l,repelStrength:c,particleColor:d,fontFamily:u,fontSize:g,width:f,height:p,devicePixelRatio:m})},[y,b,M,s,o,r,a,h,l,c,d,u,g,f,p,m,function(t){$&&$.morph(t)},function(){$&&$.scatter()},function(t){$&&$.updateConfig(t)},function(){$&&($.destroy(),n(20,$=null))},$,function(t){x[t?"unshift":"push"](()=>{M=t,n(2,M)})}]}class X extends I{constructor(t){super(),P(this,t,B,Y,h,{text:3,densityStep:4,maxParticles:5,pointSize:6,ease:7,repelRadius:8,repelStrength:9,particleColor:10,fontFamily:11,fontSize:12,width:13,height:14,devicePixelRatio:15,className:0,style:1,morph:16,scatter:17,updateConfig:18,destroy:19})}get morph(){return this.$$.ctx[16]}get scatter(){return this.$$.ctx[17]}get updateConfig(){return this.$$.ctx[18]}get destroy(){return this.$$.ctx[19]}}function G(t){let e;return{c(){e=g("div"),f(e,"class",t[0]),f(e,"style",t[1])},m(i,n){d(i,e,n),t[18](e)},p(t,[i]){1&i&&f(e,"class",t[0]),2&i&&f(e,"style",t[1])},i:n,o:n,d(i){i&&u(e),t[18](null)}}}function J(t,e,n){let{targetValue:s=0}=e,{duration:o=2e3}=e,{startValue:r=0}=e,{enabled:a=!0}=e,{easing:h=t=>t}=e,{threshold:l=.2}=e,{rootMargin:c="0px 0px -100px 0px"}=e,{triggerOnce:d=!1}=e,{className:u=""}=e,{style:g={}}=e;const f=i.createEventDispatcher();let p,m=null;return i.onMount(()=>{if(!p)return;n(17,m=new L(p,{targetValue:s,duration:o,startValue:r,enabled:a,easing:h,threshold:l,rootMargin:c,triggerOnce:d,onUpdate:t=>{f("update",t)},onComplete:()=>{f("complete")}}))}),i.onDestroy(()=>{m&&(m.destroy(),n(17,m=null))}),t.$$set=t=>{"targetValue"in t&&n(3,s=t.targetValue),"duration"in t&&n(4,o=t.duration),"startValue"in t&&n(5,r=t.startValue),"enabled"in t&&n(6,a=t.enabled),"easing"in t&&n(7,h=t.easing),"threshold"in t&&n(8,l=t.threshold),"rootMargin"in t&&n(9,c=t.rootMargin),"triggerOnce"in t&&n(10,d=t.triggerOnce),"className"in t&&n(0,u=t.className),"style"in t&&n(1,g=t.style)},t.$$.update=()=>{133112&t.$$.dirty&&m&&m.updateConfig({targetValue:s,duration:o,startValue:r,enabled:a,easing:h,threshold:l,rootMargin:c,triggerOnce:d,onUpdate:t=>{f("update",t)},onComplete:()=>{f("complete")}})},[u,g,p,s,o,r,a,h,l,c,d,function(){m&&m.start()},function(){m&&m.stop()},function(){m&&m.reset()},function(){return m?m.getValue():0},function(t){m&&m.updateConfig(t)},function(){m&&(m.destroy(),n(17,m=null))},m,function(t){x[t?"unshift":"push"](()=>{p=t,n(2,p)})}]}function K(t){let e;return{c(){e=g("div"),f(e,"class",t[1]),f(e,"style",t[2])},m(i,n){d(i,e,n),t[8](e)},p:n,i:n,o:n,d(i){i&&u(e),t[8](null)}}}function Q(t,e,n){let s,o;l(t,effect,t=>n(10,s=t)),l(t,props,t=>n(11,o=t));let{text:r,speed:a=50,delay:h=0,enabled:c=!0,threshold:d=.2,rootMargin:u="0px 0px -100px 0px",triggerOnce:g=!1,showCursor:f=!0,cursorChar:p="|",className:m="",style:y="",onUpdate:b,onComplete:v}=o(),M=null,$=null;return i.onMount(()=>{if(!M)return;$=new W(M,{text:r,speed:a,delay:h,enabled:c,threshold:d,rootMargin:u,triggerOnce:g,showCursor:f,cursorChar:p,onUpdate:b,onComplete:v})}),i.onDestroy(()=>{$&&($.destroy(),$=null)}),s(()=>{$&&r!==$.originalText&&$.setText(r)}),[M,m,y,function(){null==$||$.start()},function(){null==$||$.stop()},function(){null==$||$.reset()},function(t){null==$||$.setText(t)},function(){$&&($.destroy(),$=null)},function(t){x[t?"unshift":"push"](()=>{M=t,n(0,M)})}]}function Z(t){let e,i;const n=t[18].default,s=function(t,e,i,n){if(t){const s=c(t,e,i,n);return t[0](s)}}(n,t,t[17],null);return{c(){e=g("div"),s&&s.c(),f(e,"class",t[0]),f(e,"style",t[1])},m(n,o){d(n,e,o),s&&s.m(e,null),t[19](e),i=!0},p(t,[o]){var r,a;s&&s.p&&(!i||131072&o)&&function(t,e,i,n,s,o){if(s){const r=c(e,i,n,o);t.p(r,s)}}(s,n,t,t[17],i?(r=n,a=t[17],r[2],a.dirty):function(t){if(t.ctx.length>32){const e=[],i=t.ctx.length/32;for(let t=0;t<i;t++)e[t]=-1;return e}return-1}(t[17]),null),(!i||1&o)&&f(e,"class",t[0]),(!i||2&o)&&f(e,"style",t[1])},i(t){i||(D(s,t),i=!0)},o(t){!function(t,e){if(t&&t.o){if(R.has(t))return;R.add(t),(void 0).c.push(()=>{R.delete(t)}),t.o(e)}}(s,t),i=!1},d(i){i&&u(e),s&&s.d(i),t[19](null)}}}function tt(t,e,n){let{$$slots:s={},$$scope:o}=e,{direction:r="bottom"}=e,{distance:a="50px"}=e,{duration:h=800}=e,{threshold:l=.1}=e,{rootMargin:c="0px"}=e,{root:d=null}=e,{triggerOnce:u=!1}=e,{enabled:g=!0}=e,{className:f=""}=e,{style:p={}}=e;const m=i.createEventDispatcher();let y,b=null;return i.onMount(()=>{if(!y)return;n(16,b=new q(y,{direction:r,distance:a,duration:h,threshold:l,rootMargin:c,root:d,triggerOnce:u,enabled:g,onStart:()=>{m("start")},onComplete:()=>{m("complete")}}))}),i.onDestroy(()=>{b&&(b.destroy(),n(16,b=null))}),t.$$set=t=>{"direction"in t&&n(3,r=t.direction),"distance"in t&&n(4,a=t.distance),"duration"in t&&n(5,h=t.duration),"threshold"in t&&n(6,l=t.threshold),"rootMargin"in t&&n(7,c=t.rootMargin),"root"in t&&n(8,d=t.root),"triggerOnce"in t&&n(9,u=t.triggerOnce),"enabled"in t&&n(10,g=t.enabled),"className"in t&&n(0,f=t.className),"style"in t&&n(1,p=t.style),"$$scope"in t&&n(17,o=t.$$scope)},t.$$.update=()=>{67576&t.$$.dirty&&b&&b.updateConfig({direction:r,distance:a,duration:h,threshold:l,rootMargin:c,root:d,triggerOnce:u,enabled:g,onStart:()=>{m("start")},onComplete:()=>{m("complete")}})},[f,p,y,r,a,h,l,c,d,u,g,function(){b&&b.start()},function(){b&&b.stop()},function(){b&&b.reset()},function(t){b&&b.updateConfig(t)},function(){b&&(b.destroy(),n(16,b=null))},b,o,s,function(t){x[t?"unshift":"push"](()=>{y=t,n(2,y)})}]}function et(t){let e;return{c(){e=g("div"),f(e,"class",t[0]),f(e,"style",t[1])},m(i,n){d(i,e,n),t[21](e)},p(t,[i]){1&i&&f(e,"class",t[0]),2&i&&f(e,"style",t[1])},i:n,o:n,d(i){i&&u(e),t[21](null)}}}function it(t,e,n){let s,{text:o=""}=e,{delay:r=.2}=e,{duration:a=.6}=e,{randomDelay:h=2}=e,{threshold:l=.1}=e,{rootMargin:c="0px"}=e,{root:d=null}=e,{triggerOnce:u=!1}=e,{enabled:g=!0}=e,{className:f=""}=e,{style:p={}}=e,{onStart:m=null}=e,{onComplete:y=null}=e,b=null;return i.onMount(()=>{if(!s)return;n(20,b=new j(s,{text:o,delay:r,duration:a,randomDelay:h,threshold:l,rootMargin:c,root:d,triggerOnce:u,enabled:g,onStart:m||void 0,onComplete:y||void 0}))}),i.onDestroy(()=>{b&&(b.destroy(),n(20,b=null))}),t.$$set=t=>{"text"in t&&n(3,o=t.text),"delay"in t&&n(4,r=t.delay),"duration"in t&&n(5,a=t.duration),"randomDelay"in t&&n(6,h=t.randomDelay),"threshold"in t&&n(7,l=t.threshold),"rootMargin"in t&&n(8,c=t.rootMargin),"root"in t&&n(9,d=t.root),"triggerOnce"in t&&n(10,u=t.triggerOnce),"enabled"in t&&n(11,g=t.enabled),"className"in t&&n(0,f=t.className),"style"in t&&n(1,p=t.style),"onStart"in t&&n(12,m=t.onStart),"onComplete"in t&&n(13,y=t.onComplete)},t.$$.update=()=>{1064952&t.$$.dirty&&b&&b.updateConfig({text:o,delay:r,duration:a,randomDelay:h,threshold:l,rootMargin:c,root:d,triggerOnce:u,enabled:g,onStart:m||void 0,onComplete:y||void 0})},[f,p,s,o,r,a,h,l,c,d,u,g,m,y,function(){b&&b.start()},function(){b&&b.stop()},function(){b&&b.reset()},function(t){b&&b.updateText(t)},function(t){b&&b.updateConfig(t)},function(){b&&(b.destroy(),n(20,b=null))},b,function(t){x[t?"unshift":"push"](()=>{s=t,n(2,s)})}]}exports.Count=class extends I{constructor(t){super(),P(this,t,J,G,h,{targetValue:3,duration:4,startValue:5,enabled:6,easing:7,threshold:8,rootMargin:9,triggerOnce:10,className:0,style:1,start:11,stop:12,reset:13,getValue:14,updateConfig:15,destroy:16})}get start(){return this.$$.ctx[11]}get stop(){return this.$$.ctx[12]}get reset(){return this.$$.ctx[13]}get getValue(){return this.$$.ctx[14]}get updateConfig(){return this.$$.ctx[15]}get destroy(){return this.$$.ctx[16]}},exports.MasonEffect=X,exports.ScrollFadeIn=class extends I{constructor(t){super(),P(this,t,tt,Z,h,{direction:3,distance:4,duration:5,threshold:6,rootMargin:7,root:8,triggerOnce:9,enabled:10,className:0,style:1,start:11,stop:12,reset:13,updateConfig:14,destroy:15})}get start(){return this.$$.ctx[11]}get stop(){return this.$$.ctx[12]}get reset(){return this.$$.ctx[13]}get updateConfig(){return this.$$.ctx[14]}get destroy(){return this.$$.ctx[15]}},exports.TextSpin=class extends I{constructor(t){super(),P(this,t,it,et,h,{text:3,delay:4,duration:5,randomDelay:6,threshold:7,rootMargin:8,root:9,triggerOnce:10,enabled:11,className:0,style:1,onStart:12,onComplete:13,start:14,stop:15,reset:16,updateText:17,updateConfig:18,destroy:19})}get start(){return this.$$.ctx[14]}get stop(){return this.$$.ctx[15]}get reset(){return this.$$.ctx[16]}get updateText(){return this.$$.ctx[17]}get updateConfig(){return this.$$.ctx[18]}get destroy(){return this.$$.ctx[19]}},exports.TextToParticle=X,exports.Typing=class extends I{constructor(t){super(),P(this,t,Q,K,h,{start:3,stop:4,reset:5,setText:6,destroy:7})}get start(){return this.$$.ctx[3]}get stop(){return this.$$.ctx[4]}get reset(){return this.$$.ctx[5]}get setText(){return this.$$.ctx[6]}get destroy(){return this.$$.ctx[7]}},exports.default=X;
@@ -1620,8 +1620,15 @@ class TextSpin {
1620
1620
  }
1621
1621
  // 설정 업데이트
1622
1622
  updateConfig(newConfig) {
1623
+ var _a;
1623
1624
  const wasActive = this.isActive;
1624
- this.stop();
1625
+ this.config.enabled;
1626
+ const isEnabledChanging = newConfig.enabled !== void 0 && newConfig.enabled !== this.config.enabled;
1627
+ if (isEnabledChanging && newConfig.enabled === false) {
1628
+ this.stop();
1629
+ } else if (wasActive) {
1630
+ this.stop();
1631
+ }
1625
1632
  this.config = {
1626
1633
  ...this.config,
1627
1634
  ...newConfig,
@@ -1641,8 +1648,12 @@ class TextSpin {
1641
1648
  }
1642
1649
  this.setupVisibilityManager();
1643
1650
  }
1644
- if (wasActive && this.config.enabled) {
1645
- this.start();
1651
+ if (this.config.enabled) {
1652
+ if (wasActive || isEnabledChanging && newConfig.enabled === true) {
1653
+ if ((_a = this.visibilityManager) == null ? void 0 : _a.getIsVisible()) {
1654
+ this.start();
1655
+ }
1656
+ }
1646
1657
  }
1647
1658
  }
1648
1659
  // 파괴 및 정리
@@ -1 +1 @@
1
- "use strict";var t=Object.defineProperty,e=(e,i,n)=>((e,i,n)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[i]=n)(e,"symbol"!=typeof i?i+"":i,n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("svelte");function n(){}function s(t){return t()}function o(){return Object.create(null)}function r(t){t.forEach(s)}function a(t){return"function"==typeof t}function l(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function c(t){t.parentNode&&t.parentNode.removeChild(t)}function h(t,e,i){null==i?t.removeAttribute(e):t.getAttribute(e)!==i&&t.setAttribute(e,i)}let d;function u(t){d=t}const f=[],g=[];let p=[];const m=[],y=Promise.resolve();let b=!1;function v(t){p.push(t)}const $=new Set;let x=0;function M(){if(0!==x)return;const t=d;do{try{for(;x<f.length;){const t=f[x];x++,u(t),O(t.$$)}}catch(e){throw f.length=0,x=0,e}for(u(null),f.length=0,x=0;g.length;)g.pop()();for(let t=0;t<p.length;t+=1){const e=p[t];$.has(e)||($.add(e),e())}p.length=0}while(f.length);for(;m.length;)m.pop()();b=!1,$.clear(),u(t)}function O(t){if(null!==t.fragment){t.update(),r(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(v)}}const C=new Set;function V(t,e){const i=t.$$;null!==i.fragment&&(!function(t){const e=[],i=[];p.forEach(n=>-1===t.indexOf(n)?e.push(n):i.push(n)),i.forEach(t=>t()),p=e}(i.after_update),r(i.on_destroy),i.fragment&&i.fragment.d(e),i.on_destroy=i.fragment=null,i.ctx=[])}function _(t,e){-1===t.$$.dirty[0]&&(f.push(t),b||(b=!0,y.then(M)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function S(t,e,i,l,h,f,g=null,p=[-1]){const m=d;u(t);const y=t.$$={fragment:null,ctx:[],props:f,update:n,not_equal:h,bound:o(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(m?m.$$.context:[])),callbacks:o(),dirty:p,skip_bound:!1,root:e.target||m.$$.root};g&&g(y.root);let b=!1;if(y.ctx=i?i(t,e.props||{},(e,i,...n)=>{const s=n.length?n[0]:i;return y.ctx&&h(y.ctx[e],y.ctx[e]=s)&&(!y.skip_bound&&y.bound[e]&&y.bound[e](s),b&&_(t,e)),i}):[],y.update(),b=!0,r(y.before_update),y.fragment=!!l&&l(y.ctx),e.target){if(e.hydrate){const t=(O=e.target,Array.from(O.childNodes));y.fragment&&y.fragment.l(t),t.forEach(c)}else y.fragment&&y.fragment.c();e.intro&&(($=t.$$.fragment)&&$.i&&(C.delete($),$.i(x))),function(t,e,i){const{fragment:n,after_update:o}=t.$$;n&&n.m(e,i),v(()=>{const e=t.$$.on_mount.map(s).filter(a);t.$$.on_destroy?t.$$.on_destroy.push(...e):r(e),t.$$.on_mount=[]}),o.forEach(v)}(t,e.target,e.anchor),M()}var $,x,O;u(m)}class w{constructor(){e(this,"$$"),e(this,"$$set")}$destroy(){V(this,1),this.$destroy=n}$on(t,e){if(!a(e))return n;const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(e),()=>{const t=i.indexOf(e);-1!==t&&i.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}"undefined"!=typeof window&&(window.__svelte||(window.__svelte={v:new Set})).v.add("4");class E{constructor(t,e={}){this.container=t,this.options={threshold:e.threshold??.1,rootMargin:e.rootMargin??"0px",root:e.root??null,onVisible:e.onVisible,onHidden:e.onHidden},this.intersectionObserver=null,this.visibilityChangeHandler=null,this.isVisible=!1,this.isPageVisible="undefined"==typeof document||!document.hidden,this.setupIntersectionObserver(),this.setupPageVisibility()}setupIntersectionObserver(){if("undefined"==typeof window||void 0===window.IntersectionObserver)return this.isVisible=!0,void(this.isPageVisible&&this.options.onVisible&&this.options.onVisible());this.intersectionObserver=new IntersectionObserver(t=>{for(const e of t)e.target===this.container&&(e.isIntersecting?(this.isVisible=!0,this.isPageVisible&&this.options.onVisible&&this.options.onVisible()):(this.isVisible=!1,this.options.onHidden&&this.options.onHidden()))},{threshold:this.options.threshold,rootMargin:this.options.rootMargin,root:this.options.root||null}),this.intersectionObserver.observe(this.container)}setupPageVisibility(){"undefined"!=typeof document&&(this.visibilityChangeHandler=()=>{const t=this.isPageVisible;this.isPageVisible=!document.hidden,document.hidden?this.options.onHidden&&this.options.onHidden():t!==this.isPageVisible&&this.isVisible&&this.options.onVisible&&this.options.onVisible()},document.addEventListener("visibilitychange",this.visibilityChangeHandler),document.hidden&&this.isVisible&&this.options.onHidden&&this.options.onHidden())}getIsVisible(){return this.isVisible&&this.isPageVisible}updateOptions(t){this.options={...this.options,...t},this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.setupIntersectionObserver()}destroy(){this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.visibilityChangeHandler&&"undefined"!=typeof document&&(document.removeEventListener("visibilitychange",this.visibilityChangeHandler),this.visibilityChangeHandler=null)}}class T{constructor(t,e){if(this.container="string"==typeof t?document.querySelector(t):t,!this.container)throw new Error("Container element not found");if(!e.text)throw new Error("Text is required");this.config={text:e.text,delay:e.delay??.2,duration:e.duration??.6,randomDelay:e.randomDelay??2,threshold:e.threshold??.1,rootMargin:e.rootMargin??"0px",root:e.root??null,triggerOnce:e.triggerOnce??!1,enabled:e.enabled??!0,onStart:e.onStart||null,onComplete:e.onComplete||null},this.visibilityManager=null,this.textElements=[],this.randomPoints=[],this.hasTriggered=!1,this.isActive=!1,this.init()}init(){this.injectStyles(),this.createTextStructure(),this.setupVisibilityManager()}injectStyles(){if(document.getElementById("masoneffect-textspin-styles"))return;const t=document.createElement("style");t.id="masoneffect-textspin-styles",t.textContent="\n .masoneffect-textspin {\n display: inline-block;\n }\n .masoneffect-textspin-char {\n display: inline-block;\n opacity: 0;\n transform: rotateY(90deg);\n }\n .masoneffect-textspin-char.active {\n opacity: 1;\n transform: rotateY(0deg);\n }\n .masoneffect-textspin-char.space {\n width: 0.25em;\n }\n ",document.head.appendChild(t)}createTextStructure(){this.container.innerHTML="",this.textElements=[],this.randomPoints=[];const t=this.config.text.split("");t.forEach(()=>{this.randomPoints.push(Math.random())}),t.forEach((t,e)=>{const i=document.createElement("span");i.className="masoneffect-textspin-char",i.style.transition=`opacity ${this.config.duration}s ease-out, transform ${this.config.duration}s ease-out`," "===t?(i.classList.add("space"),i.innerHTML="&nbsp;"):i.textContent=t,this.container.appendChild(i),this.textElements.push(i)}),this.container.classList.add("masoneffect-textspin")}setupVisibilityManager(){this.visibilityManager=new E(this.container,{threshold:this.config.threshold,rootMargin:this.config.rootMargin,root:this.config.root,onVisible:()=>{this.config.enabled&&(this.config.triggerOnce&&this.hasTriggered||(this.hasTriggered=!0,this.start()))},onHidden:()=>{this.config.enabled&&(this.stop(),this.config.triggerOnce||(this.hasTriggered=!1))}})}start(){if(this.isActive)return;this.isActive=!0,this.config.onStart&&this.config.onStart(),this.textElements.forEach((t,e)=>{const i=this.config.delay+this.randomPoints[e]*this.config.randomDelay;t.style.transitionDelay=`${i}s`,requestAnimationFrame(()=>{t.classList.add("active")})});const t=this.config.delay+this.config.randomDelay+this.config.duration;setTimeout(()=>{this.config.onComplete&&this.config.onComplete()},1e3*t)}stop(){this.isActive&&(this.isActive=!1,this.textElements.forEach(t=>{t.classList.remove("active"),t.style.transitionDelay=""}))}reset(){this.stop(),this.hasTriggered=!1}updateText(t){this.config.text=t,this.createTextStructure(),this.isActive&&this.start()}updateTransitions(){this.textElements.forEach(t=>{t.style.transition=`opacity ${this.config.duration}s ease-out, transform ${this.config.duration}s ease-out`})}updateConfig(t){const e=this.isActive;this.stop(),this.config={...this.config,...t,text:t.text??this.config.text,onStart:t.onStart??this.config.onStart,onComplete:t.onComplete??this.config.onComplete},void 0!==t.text?this.createTextStructure():void 0!==t.duration&&this.updateTransitions(),void 0===t.threshold&&void 0===t.rootMargin&&void 0===t.root||(this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null),this.setupVisibilityManager()),e&&this.config.enabled&&this.start()}destroy(){this.stop(),this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null),this.container.innerHTML="",this.container.classList.remove("masoneffect-textspin")}}function H(t){let e;return{c(){var i;i="div",e=document.createElement(i),h(e,"class",t[0]),h(e,"style",t[1])},m(i,n){!function(t,e,i){t.insertBefore(e,i||null)}(i,e,n),t[21](e)},p(t,[i]){1&i&&h(e,"class",t[0]),2&i&&h(e,"style",t[1])},i:n,o:n,d(i){i&&c(e),t[21](null)}}}function P(t,e,n){let s,{text:o=""}=e,{delay:r=.2}=e,{duration:a=.6}=e,{randomDelay:l=2}=e,{threshold:c=.1}=e,{rootMargin:h="0px"}=e,{root:d=null}=e,{triggerOnce:u=!1}=e,{enabled:f=!0}=e,{className:p=""}=e,{style:m={}}=e,{onStart:y=null}=e,{onComplete:b=null}=e,v=null;return i.onMount(()=>{if(!s)return;n(20,v=new T(s,{text:o,delay:r,duration:a,randomDelay:l,threshold:c,rootMargin:h,root:d,triggerOnce:u,enabled:f,onStart:y||void 0,onComplete:b||void 0}))}),i.onDestroy(()=>{v&&(v.destroy(),n(20,v=null))}),t.$$set=t=>{"text"in t&&n(3,o=t.text),"delay"in t&&n(4,r=t.delay),"duration"in t&&n(5,a=t.duration),"randomDelay"in t&&n(6,l=t.randomDelay),"threshold"in t&&n(7,c=t.threshold),"rootMargin"in t&&n(8,h=t.rootMargin),"root"in t&&n(9,d=t.root),"triggerOnce"in t&&n(10,u=t.triggerOnce),"enabled"in t&&n(11,f=t.enabled),"className"in t&&n(0,p=t.className),"style"in t&&n(1,m=t.style),"onStart"in t&&n(12,y=t.onStart),"onComplete"in t&&n(13,b=t.onComplete)},t.$$.update=()=>{1064952&t.$$.dirty&&v&&v.updateConfig({text:o,delay:r,duration:a,randomDelay:l,threshold:c,rootMargin:h,root:d,triggerOnce:u,enabled:f,onStart:y||void 0,onComplete:b||void 0})},[p,m,s,o,r,a,l,c,h,d,u,f,y,b,function(){v&&v.start()},function(){v&&v.stop()},function(){v&&v.reset()},function(t){v&&v.updateText(t)},function(t){v&&v.updateConfig(t)},function(){v&&(v.destroy(),n(20,v=null))},v,function(t){g[t?"unshift":"push"](()=>{s=t,n(2,s)})}]}exports.TextSpin=T,exports.default=class extends w{constructor(t){super(),S(this,t,P,H,l,{text:3,delay:4,duration:5,randomDelay:6,threshold:7,rootMargin:8,root:9,triggerOnce:10,enabled:11,className:0,style:1,onStart:12,onComplete:13,start:14,stop:15,reset:16,updateText:17,updateConfig:18,destroy:19})}get start(){return this.$$.ctx[14]}get stop(){return this.$$.ctx[15]}get reset(){return this.$$.ctx[16]}get updateText(){return this.$$.ctx[17]}get updateConfig(){return this.$$.ctx[18]}get destroy(){return this.$$.ctx[19]}};
1
+ "use strict";var t=Object.defineProperty,e=(e,i,n)=>((e,i,n)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[i]=n)(e,"symbol"!=typeof i?i+"":i,n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("svelte");function n(){}function s(t){return t()}function o(){return Object.create(null)}function r(t){t.forEach(s)}function a(t){return"function"==typeof t}function l(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function c(t){t.parentNode&&t.parentNode.removeChild(t)}function h(t,e,i){null==i?t.removeAttribute(e):t.getAttribute(e)!==i&&t.setAttribute(e,i)}let d;function u(t){d=t}const f=[],g=[];let p=[];const b=[],m=Promise.resolve();let y=!1;function v(t){p.push(t)}const $=new Set;let x=0;function M(){if(0!==x)return;const t=d;do{try{for(;x<f.length;){const t=f[x];x++,u(t),O(t.$$)}}catch(e){throw f.length=0,x=0,e}for(u(null),f.length=0,x=0;g.length;)g.pop()();for(let t=0;t<p.length;t+=1){const e=p[t];$.has(e)||($.add(e),e())}p.length=0}while(f.length);for(;b.length;)b.pop()();y=!1,$.clear(),u(t)}function O(t){if(null!==t.fragment){t.update(),r(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(v)}}const C=new Set;function V(t,e){const i=t.$$;null!==i.fragment&&(!function(t){const e=[],i=[];p.forEach(n=>-1===t.indexOf(n)?e.push(n):i.push(n)),i.forEach(t=>t()),p=e}(i.after_update),r(i.on_destroy),i.fragment&&i.fragment.d(e),i.on_destroy=i.fragment=null,i.ctx=[])}function _(t,e){-1===t.$$.dirty[0]&&(f.push(t),y||(y=!0,m.then(M)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function S(t,e,i,l,h,f,g=null,p=[-1]){const b=d;u(t);const m=t.$$={fragment:null,ctx:[],props:f,update:n,not_equal:h,bound:o(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(b?b.$$.context:[])),callbacks:o(),dirty:p,skip_bound:!1,root:e.target||b.$$.root};g&&g(m.root);let y=!1;if(m.ctx=i?i(t,e.props||{},(e,i,...n)=>{const s=n.length?n[0]:i;return m.ctx&&h(m.ctx[e],m.ctx[e]=s)&&(!m.skip_bound&&m.bound[e]&&m.bound[e](s),y&&_(t,e)),i}):[],m.update(),y=!0,r(m.before_update),m.fragment=!!l&&l(m.ctx),e.target){if(e.hydrate){const t=(O=e.target,Array.from(O.childNodes));m.fragment&&m.fragment.l(t),t.forEach(c)}else m.fragment&&m.fragment.c();e.intro&&(($=t.$$.fragment)&&$.i&&(C.delete($),$.i(x))),function(t,e,i){const{fragment:n,after_update:o}=t.$$;n&&n.m(e,i),v(()=>{const e=t.$$.on_mount.map(s).filter(a);t.$$.on_destroy?t.$$.on_destroy.push(...e):r(e),t.$$.on_mount=[]}),o.forEach(v)}(t,e.target,e.anchor),M()}var $,x,O;u(b)}class w{constructor(){e(this,"$$"),e(this,"$$set")}$destroy(){V(this,1),this.$destroy=n}$on(t,e){if(!a(e))return n;const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(e),()=>{const t=i.indexOf(e);-1!==t&&i.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}"undefined"!=typeof window&&(window.__svelte||(window.__svelte={v:new Set})).v.add("4");class E{constructor(t,e={}){this.container=t,this.options={threshold:e.threshold??.1,rootMargin:e.rootMargin??"0px",root:e.root??null,onVisible:e.onVisible,onHidden:e.onHidden},this.intersectionObserver=null,this.visibilityChangeHandler=null,this.isVisible=!1,this.isPageVisible="undefined"==typeof document||!document.hidden,this.setupIntersectionObserver(),this.setupPageVisibility()}setupIntersectionObserver(){if("undefined"==typeof window||void 0===window.IntersectionObserver)return this.isVisible=!0,void(this.isPageVisible&&this.options.onVisible&&this.options.onVisible());this.intersectionObserver=new IntersectionObserver(t=>{for(const e of t)e.target===this.container&&(e.isIntersecting?(this.isVisible=!0,this.isPageVisible&&this.options.onVisible&&this.options.onVisible()):(this.isVisible=!1,this.options.onHidden&&this.options.onHidden()))},{threshold:this.options.threshold,rootMargin:this.options.rootMargin,root:this.options.root||null}),this.intersectionObserver.observe(this.container)}setupPageVisibility(){"undefined"!=typeof document&&(this.visibilityChangeHandler=()=>{const t=this.isPageVisible;this.isPageVisible=!document.hidden,document.hidden?this.options.onHidden&&this.options.onHidden():t!==this.isPageVisible&&this.isVisible&&this.options.onVisible&&this.options.onVisible()},document.addEventListener("visibilitychange",this.visibilityChangeHandler),document.hidden&&this.isVisible&&this.options.onHidden&&this.options.onHidden())}getIsVisible(){return this.isVisible&&this.isPageVisible}updateOptions(t){this.options={...this.options,...t},this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.setupIntersectionObserver()}destroy(){this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.visibilityChangeHandler&&"undefined"!=typeof document&&(document.removeEventListener("visibilitychange",this.visibilityChangeHandler),this.visibilityChangeHandler=null)}}class T{constructor(t,e){if(this.container="string"==typeof t?document.querySelector(t):t,!this.container)throw new Error("Container element not found");if(!e.text)throw new Error("Text is required");this.config={text:e.text,delay:e.delay??.2,duration:e.duration??.6,randomDelay:e.randomDelay??2,threshold:e.threshold??.1,rootMargin:e.rootMargin??"0px",root:e.root??null,triggerOnce:e.triggerOnce??!1,enabled:e.enabled??!0,onStart:e.onStart||null,onComplete:e.onComplete||null},this.visibilityManager=null,this.textElements=[],this.randomPoints=[],this.hasTriggered=!1,this.isActive=!1,this.init()}init(){this.injectStyles(),this.createTextStructure(),this.setupVisibilityManager()}injectStyles(){if(document.getElementById("masoneffect-textspin-styles"))return;const t=document.createElement("style");t.id="masoneffect-textspin-styles",t.textContent="\n .masoneffect-textspin {\n display: inline-block;\n }\n .masoneffect-textspin-char {\n display: inline-block;\n opacity: 0;\n transform: rotateY(90deg);\n }\n .masoneffect-textspin-char.active {\n opacity: 1;\n transform: rotateY(0deg);\n }\n .masoneffect-textspin-char.space {\n width: 0.25em;\n }\n ",document.head.appendChild(t)}createTextStructure(){this.container.innerHTML="",this.textElements=[],this.randomPoints=[];const t=this.config.text.split("");t.forEach(()=>{this.randomPoints.push(Math.random())}),t.forEach((t,e)=>{const i=document.createElement("span");i.className="masoneffect-textspin-char",i.style.transition=`opacity ${this.config.duration}s ease-out, transform ${this.config.duration}s ease-out`," "===t?(i.classList.add("space"),i.innerHTML="&nbsp;"):i.textContent=t,this.container.appendChild(i),this.textElements.push(i)}),this.container.classList.add("masoneffect-textspin")}setupVisibilityManager(){this.visibilityManager=new E(this.container,{threshold:this.config.threshold,rootMargin:this.config.rootMargin,root:this.config.root,onVisible:()=>{this.config.enabled&&(this.config.triggerOnce&&this.hasTriggered||(this.hasTriggered=!0,this.start()))},onHidden:()=>{this.config.enabled&&(this.stop(),this.config.triggerOnce||(this.hasTriggered=!1))}})}start(){if(this.isActive)return;this.isActive=!0,this.config.onStart&&this.config.onStart(),this.textElements.forEach((t,e)=>{const i=this.config.delay+this.randomPoints[e]*this.config.randomDelay;t.style.transitionDelay=`${i}s`,requestAnimationFrame(()=>{t.classList.add("active")})});const t=this.config.delay+this.config.randomDelay+this.config.duration;setTimeout(()=>{this.config.onComplete&&this.config.onComplete()},1e3*t)}stop(){this.isActive&&(this.isActive=!1,this.textElements.forEach(t=>{t.classList.remove("active"),t.style.transitionDelay=""}))}reset(){this.stop(),this.hasTriggered=!1}updateText(t){this.config.text=t,this.createTextStructure(),this.isActive&&this.start()}updateTransitions(){this.textElements.forEach(t=>{t.style.transition=`opacity ${this.config.duration}s ease-out, transform ${this.config.duration}s ease-out`})}updateConfig(t){var e;const i=this.isActive;this.config.enabled;const n=void 0!==t.enabled&&t.enabled!==this.config.enabled;(n&&!1===t.enabled||i)&&this.stop(),this.config={...this.config,...t,text:t.text??this.config.text,onStart:t.onStart??this.config.onStart,onComplete:t.onComplete??this.config.onComplete},void 0!==t.text?this.createTextStructure():void 0!==t.duration&&this.updateTransitions(),void 0===t.threshold&&void 0===t.rootMargin&&void 0===t.root||(this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null),this.setupVisibilityManager()),this.config.enabled&&(i||n&&!0===t.enabled)&&(null==(e=this.visibilityManager)?void 0:e.getIsVisible())&&this.start()}destroy(){this.stop(),this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null),this.container.innerHTML="",this.container.classList.remove("masoneffect-textspin")}}function H(t){let e;return{c(){var i;i="div",e=document.createElement(i),h(e,"class",t[0]),h(e,"style",t[1])},m(i,n){!function(t,e,i){t.insertBefore(e,i||null)}(i,e,n),t[21](e)},p(t,[i]){1&i&&h(e,"class",t[0]),2&i&&h(e,"style",t[1])},i:n,o:n,d(i){i&&c(e),t[21](null)}}}function P(t,e,n){let s,{text:o=""}=e,{delay:r=.2}=e,{duration:a=.6}=e,{randomDelay:l=2}=e,{threshold:c=.1}=e,{rootMargin:h="0px"}=e,{root:d=null}=e,{triggerOnce:u=!1}=e,{enabled:f=!0}=e,{className:p=""}=e,{style:b={}}=e,{onStart:m=null}=e,{onComplete:y=null}=e,v=null;return i.onMount(()=>{if(!s)return;n(20,v=new T(s,{text:o,delay:r,duration:a,randomDelay:l,threshold:c,rootMargin:h,root:d,triggerOnce:u,enabled:f,onStart:m||void 0,onComplete:y||void 0}))}),i.onDestroy(()=>{v&&(v.destroy(),n(20,v=null))}),t.$$set=t=>{"text"in t&&n(3,o=t.text),"delay"in t&&n(4,r=t.delay),"duration"in t&&n(5,a=t.duration),"randomDelay"in t&&n(6,l=t.randomDelay),"threshold"in t&&n(7,c=t.threshold),"rootMargin"in t&&n(8,h=t.rootMargin),"root"in t&&n(9,d=t.root),"triggerOnce"in t&&n(10,u=t.triggerOnce),"enabled"in t&&n(11,f=t.enabled),"className"in t&&n(0,p=t.className),"style"in t&&n(1,b=t.style),"onStart"in t&&n(12,m=t.onStart),"onComplete"in t&&n(13,y=t.onComplete)},t.$$.update=()=>{1064952&t.$$.dirty&&v&&v.updateConfig({text:o,delay:r,duration:a,randomDelay:l,threshold:c,rootMargin:h,root:d,triggerOnce:u,enabled:f,onStart:m||void 0,onComplete:y||void 0})},[p,b,s,o,r,a,l,c,h,d,u,f,m,y,function(){v&&v.start()},function(){v&&v.stop()},function(){v&&v.reset()},function(t){v&&v.updateText(t)},function(t){v&&v.updateConfig(t)},function(){v&&(v.destroy(),n(20,v=null))},v,function(t){g[t?"unshift":"push"](()=>{s=t,n(2,s)})}]}exports.TextSpin=T,exports.default=class extends w{constructor(t){super(),S(this,t,P,H,l,{text:3,delay:4,duration:5,randomDelay:6,threshold:7,rootMargin:8,root:9,triggerOnce:10,enabled:11,className:0,style:1,onStart:12,onComplete:13,start:14,stop:15,reset:16,updateText:17,updateConfig:18,destroy:19})}get start(){return this.$$.ctx[14]}get stop(){return this.$$.ctx[15]}get reset(){return this.$$.ctx[16]}get updateText(){return this.$$.ctx[17]}get updateConfig(){return this.$$.ctx[18]}get destroy(){return this.$$.ctx[19]}};
@@ -521,8 +521,15 @@ class TextSpin {
521
521
  }
522
522
  // 설정 업데이트
523
523
  updateConfig(newConfig) {
524
+ var _a;
524
525
  const wasActive = this.isActive;
525
- this.stop();
526
+ this.config.enabled;
527
+ const isEnabledChanging = newConfig.enabled !== void 0 && newConfig.enabled !== this.config.enabled;
528
+ if (isEnabledChanging && newConfig.enabled === false) {
529
+ this.stop();
530
+ } else if (wasActive) {
531
+ this.stop();
532
+ }
526
533
  this.config = {
527
534
  ...this.config,
528
535
  ...newConfig,
@@ -542,8 +549,12 @@ class TextSpin {
542
549
  }
543
550
  this.setupVisibilityManager();
544
551
  }
545
- if (wasActive && this.config.enabled) {
546
- this.start();
552
+ if (this.config.enabled) {
553
+ if (wasActive || isEnabledChanging && newConfig.enabled === true) {
554
+ if ((_a = this.visibilityManager) == null ? void 0 : _a.getIsVisible()) {
555
+ this.start();
556
+ }
557
+ }
547
558
  }
548
559
  }
549
560
  // 파괴 및 정리
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/textSpin/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,qBAAa,QAAQ;IACnB,SAAS,EAAE,WAAW,CAAC;IACvB,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,eAAe,EAAE,SAAS,GAAG,YAAY,GAAG,MAAM,CAAC,CAAC,GAAG;QAC3E,IAAI,EAAE,WAAW,GAAG,IAAI,CAAC;QACzB,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;QACpC,UAAU,EAAE,eAAe,CAAC,YAAY,CAAC,CAAC;KAC3C,CAAC;IACF,iBAAiB,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC5C,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;gBAEN,SAAS,EAAE,WAAW,GAAG,MAAM,EAAE,OAAO,EAAE,eAAe;IAwCrE,IAAI,IAAI,IAAI;IAWZ,YAAY,IAAI,IAAI;IA4BpB,mBAAmB,IAAI,IAAI;IAsC3B,sBAAsB,IAAI,IAAI;IAyB9B,KAAK,IAAI,IAAI;IA6Bb,IAAI,IAAI,IAAI;IAYZ,KAAK,IAAI,IAAI;IAMb,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAWjC,iBAAiB,IAAI,IAAI;IAOzB,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,IAAI;IAoCvD,OAAO,IAAI,IAAI;CAUhB;AAGD,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/textSpin/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,qBAAa,QAAQ;IACnB,SAAS,EAAE,WAAW,CAAC;IACvB,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,eAAe,EAAE,SAAS,GAAG,YAAY,GAAG,MAAM,CAAC,CAAC,GAAG;QAC3E,IAAI,EAAE,WAAW,GAAG,IAAI,CAAC;QACzB,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;QACpC,UAAU,EAAE,eAAe,CAAC,YAAY,CAAC,CAAC;KAC3C,CAAC;IACF,iBAAiB,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC5C,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;gBAEN,SAAS,EAAE,WAAW,GAAG,MAAM,EAAE,OAAO,EAAE,eAAe;IAwCrE,IAAI,IAAI,IAAI;IAWZ,YAAY,IAAI,IAAI;IA4BpB,mBAAmB,IAAI,IAAI;IAsC3B,sBAAsB,IAAI,IAAI;IAyB9B,KAAK,IAAI,IAAI;IA6Bb,IAAI,IAAI,IAAI;IAYZ,KAAK,IAAI,IAAI;IAMb,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAWjC,iBAAiB,IAAI,IAAI;IAOzB,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,IAAI;IAmDvD,OAAO,IAAI,IAAI;CAUhB;AAGD,eAAe,QAAQ,CAAC"}
@@ -1 +1 @@
1
- Object.defineProperty(exports,"t",{value:!0});class t{constructor(t,s={}){this.container=t,this.options={threshold:s.threshold??.1,rootMargin:s.rootMargin??"0px",root:s.root??null,onVisible:s.onVisible,onHidden:s.onHidden},this.intersectionObserver=null,this.visibilityChangeHandler=null,this.isVisible=!1,this.isPageVisible="undefined"==typeof document||!document.hidden,this.setupIntersectionObserver(),this.setupPageVisibility()}setupIntersectionObserver(){if("undefined"==typeof window||void 0===window.IntersectionObserver)return this.isVisible=!0,void(this.isPageVisible&&this.options.onVisible&&this.options.onVisible());this.intersectionObserver=new IntersectionObserver(t=>{for(const s of t)s.target===this.container&&(s.isIntersecting?(this.isVisible=!0,this.isPageVisible&&this.options.onVisible&&this.options.onVisible()):(this.isVisible=!1,this.options.onHidden&&this.options.onHidden()))},{threshold:this.options.threshold,rootMargin:this.options.rootMargin,root:this.options.root||null}),this.intersectionObserver.observe(this.container)}setupPageVisibility(){"undefined"!=typeof document&&(this.visibilityChangeHandler=()=>{const t=this.isPageVisible;this.isPageVisible=!document.hidden,document.hidden?this.options.onHidden&&this.options.onHidden():t!==this.isPageVisible&&this.isVisible&&this.options.onVisible&&this.options.onVisible()},document.addEventListener("visibilitychange",this.visibilityChangeHandler),document.hidden&&this.isVisible&&this.options.onHidden&&this.options.onHidden())}getIsVisible(){return this.isVisible&&this.isPageVisible}updateOptions(t){this.options={...this.options,...t},this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.setupIntersectionObserver()}destroy(){this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.visibilityChangeHandler&&"undefined"!=typeof document&&(document.removeEventListener("visibilitychange",this.visibilityChangeHandler),this.visibilityChangeHandler=null)}}class s{constructor(t,s){if(this.container="string"==typeof t?document.querySelector(t):t,!this.container)throw new Error("Container element not found");if(!s.text)throw new Error("Text is required");this.config={text:s.text,delay:s.delay??.2,duration:s.duration??.6,randomDelay:s.randomDelay??2,threshold:s.threshold??.1,rootMargin:s.rootMargin??"0px",root:s.root??null,triggerOnce:s.triggerOnce??!1,enabled:s.enabled??!0,onStart:s.onStart||null,onComplete:s.onComplete||null},this.visibilityManager=null,this.textElements=[],this.randomPoints=[],this.hasTriggered=!1,this.isActive=!1,this.init()}init(){this.injectStyles(),this.createTextStructure(),this.setupVisibilityManager()}injectStyles(){if(document.getElementById("masoneffect-textspin-styles"))return;const t=document.createElement("style");t.id="masoneffect-textspin-styles",t.textContent="\n .masoneffect-textspin {\n display: inline-block;\n }\n .masoneffect-textspin-char {\n display: inline-block;\n opacity: 0;\n transform: rotateY(90deg);\n }\n .masoneffect-textspin-char.active {\n opacity: 1;\n transform: rotateY(0deg);\n }\n .masoneffect-textspin-char.space {\n width: 0.25em;\n }\n ",document.head.appendChild(t)}createTextStructure(){this.container.innerHTML="",this.textElements=[],this.randomPoints=[];const t=this.config.text.split("");t.forEach(()=>{this.randomPoints.push(Math.random())}),t.forEach((t,s)=>{const i=document.createElement("span");i.className="masoneffect-textspin-char",i.style.transition=`opacity ${this.config.duration}s ease-out, transform ${this.config.duration}s ease-out`," "===t?(i.classList.add("space"),i.innerHTML="&nbsp;"):i.textContent=t,this.container.appendChild(i),this.textElements.push(i)}),this.container.classList.add("masoneffect-textspin")}setupVisibilityManager(){this.visibilityManager=new t(this.container,{threshold:this.config.threshold,rootMargin:this.config.rootMargin,root:this.config.root,onVisible:()=>{this.config.enabled&&(this.config.triggerOnce&&this.hasTriggered||(this.hasTriggered=!0,this.start()))},onHidden:()=>{this.config.enabled&&(this.stop(),this.config.triggerOnce||(this.hasTriggered=!1))}})}start(){if(this.isActive)return;this.isActive=!0,this.config.onStart&&this.config.onStart(),this.textElements.forEach((t,s)=>{const i=this.config.delay+this.randomPoints[s]*this.config.randomDelay;t.style.transitionDelay=`${i}s`,requestAnimationFrame(()=>{t.classList.add("active")})});const t=this.config.delay+this.config.randomDelay+this.config.duration;setTimeout(()=>{this.config.onComplete&&this.config.onComplete()},1e3*t)}stop(){this.isActive&&(this.isActive=!1,this.textElements.forEach(t=>{t.classList.remove("active"),t.style.transitionDelay=""}))}reset(){this.stop(),this.hasTriggered=!1}updateText(t){this.config.text=t,this.createTextStructure(),this.isActive&&this.start()}updateTransitions(){this.textElements.forEach(t=>{t.style.transition=`opacity ${this.config.duration}s ease-out, transform ${this.config.duration}s ease-out`})}updateConfig(t){const s=this.isActive;this.stop(),this.config={...this.config,...t,text:t.text??this.config.text,onStart:t.onStart??this.config.onStart,onComplete:t.onComplete??this.config.onComplete},void 0!==t.text?this.createTextStructure():void 0!==t.duration&&this.updateTransitions(),void 0===t.threshold&&void 0===t.rootMargin&&void 0===t.root||(this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null),this.setupVisibilityManager()),s&&this.config.enabled&&this.start()}destroy(){this.stop(),this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null),this.container.innerHTML="",this.container.classList.remove("masoneffect-textspin")}}exports.TextSpin=s,exports.default=s;
1
+ Object.defineProperty(exports,"t",{value:!0});class t{constructor(t,s={}){this.container=t,this.options={threshold:s.threshold??.1,rootMargin:s.rootMargin??"0px",root:s.root??null,onVisible:s.onVisible,onHidden:s.onHidden},this.intersectionObserver=null,this.visibilityChangeHandler=null,this.isVisible=!1,this.isPageVisible="undefined"==typeof document||!document.hidden,this.setupIntersectionObserver(),this.setupPageVisibility()}setupIntersectionObserver(){if("undefined"==typeof window||void 0===window.IntersectionObserver)return this.isVisible=!0,void(this.isPageVisible&&this.options.onVisible&&this.options.onVisible());this.intersectionObserver=new IntersectionObserver(t=>{for(const s of t)s.target===this.container&&(s.isIntersecting?(this.isVisible=!0,this.isPageVisible&&this.options.onVisible&&this.options.onVisible()):(this.isVisible=!1,this.options.onHidden&&this.options.onHidden()))},{threshold:this.options.threshold,rootMargin:this.options.rootMargin,root:this.options.root||null}),this.intersectionObserver.observe(this.container)}setupPageVisibility(){"undefined"!=typeof document&&(this.visibilityChangeHandler=()=>{const t=this.isPageVisible;this.isPageVisible=!document.hidden,document.hidden?this.options.onHidden&&this.options.onHidden():t!==this.isPageVisible&&this.isVisible&&this.options.onVisible&&this.options.onVisible()},document.addEventListener("visibilitychange",this.visibilityChangeHandler),document.hidden&&this.isVisible&&this.options.onHidden&&this.options.onHidden())}getIsVisible(){return this.isVisible&&this.isPageVisible}updateOptions(t){this.options={...this.options,...t},this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.setupIntersectionObserver()}destroy(){this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.visibilityChangeHandler&&"undefined"!=typeof document&&(document.removeEventListener("visibilitychange",this.visibilityChangeHandler),this.visibilityChangeHandler=null)}}class s{constructor(t,s){if(this.container="string"==typeof t?document.querySelector(t):t,!this.container)throw new Error("Container element not found");if(!s.text)throw new Error("Text is required");this.config={text:s.text,delay:s.delay??.2,duration:s.duration??.6,randomDelay:s.randomDelay??2,threshold:s.threshold??.1,rootMargin:s.rootMargin??"0px",root:s.root??null,triggerOnce:s.triggerOnce??!1,enabled:s.enabled??!0,onStart:s.onStart||null,onComplete:s.onComplete||null},this.visibilityManager=null,this.textElements=[],this.randomPoints=[],this.hasTriggered=!1,this.isActive=!1,this.init()}init(){this.injectStyles(),this.createTextStructure(),this.setupVisibilityManager()}injectStyles(){if(document.getElementById("masoneffect-textspin-styles"))return;const t=document.createElement("style");t.id="masoneffect-textspin-styles",t.textContent="\n .masoneffect-textspin {\n display: inline-block;\n }\n .masoneffect-textspin-char {\n display: inline-block;\n opacity: 0;\n transform: rotateY(90deg);\n }\n .masoneffect-textspin-char.active {\n opacity: 1;\n transform: rotateY(0deg);\n }\n .masoneffect-textspin-char.space {\n width: 0.25em;\n }\n ",document.head.appendChild(t)}createTextStructure(){this.container.innerHTML="",this.textElements=[],this.randomPoints=[];const t=this.config.text.split("");t.forEach(()=>{this.randomPoints.push(Math.random())}),t.forEach((t,s)=>{const i=document.createElement("span");i.className="masoneffect-textspin-char",i.style.transition=`opacity ${this.config.duration}s ease-out, transform ${this.config.duration}s ease-out`," "===t?(i.classList.add("space"),i.innerHTML="&nbsp;"):i.textContent=t,this.container.appendChild(i),this.textElements.push(i)}),this.container.classList.add("masoneffect-textspin")}setupVisibilityManager(){this.visibilityManager=new t(this.container,{threshold:this.config.threshold,rootMargin:this.config.rootMargin,root:this.config.root,onVisible:()=>{this.config.enabled&&(this.config.triggerOnce&&this.hasTriggered||(this.hasTriggered=!0,this.start()))},onHidden:()=>{this.config.enabled&&(this.stop(),this.config.triggerOnce||(this.hasTriggered=!1))}})}start(){if(this.isActive)return;this.isActive=!0,this.config.onStart&&this.config.onStart(),this.textElements.forEach((t,s)=>{const i=this.config.delay+this.randomPoints[s]*this.config.randomDelay;t.style.transitionDelay=`${i}s`,requestAnimationFrame(()=>{t.classList.add("active")})});const t=this.config.delay+this.config.randomDelay+this.config.duration;setTimeout(()=>{this.config.onComplete&&this.config.onComplete()},1e3*t)}stop(){this.isActive&&(this.isActive=!1,this.textElements.forEach(t=>{t.classList.remove("active"),t.style.transitionDelay=""}))}reset(){this.stop(),this.hasTriggered=!1}updateText(t){this.config.text=t,this.createTextStructure(),this.isActive&&this.start()}updateTransitions(){this.textElements.forEach(t=>{t.style.transition=`opacity ${this.config.duration}s ease-out, transform ${this.config.duration}s ease-out`})}updateConfig(t){const s=this.isActive;this.config.enabled;const i=void 0!==t.enabled&&t.enabled!==this.config.enabled;(i&&!1===t.enabled||s)&&this.stop(),this.config={...this.config,...t,text:t.text??this.config.text,onStart:t.onStart??this.config.onStart,onComplete:t.onComplete??this.config.onComplete},void 0!==t.text?this.createTextStructure():void 0!==t.duration&&this.updateTransitions(),void 0===t.threshold&&void 0===t.rootMargin&&void 0===t.root||(this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null),this.setupVisibilityManager()),this.config.enabled&&(s||i&&!0===t.enabled)&&this.visibilityManager?.getIsVisible()&&this.start()}destroy(){this.stop(),this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null),this.container.innerHTML="",this.container.classList.remove("masoneffect-textspin")}}exports.TextSpin=s,exports.default=s;
@@ -1 +1 @@
1
- class t{constructor(t,s={}){this.container=t,this.options={threshold:s.threshold??.1,rootMargin:s.rootMargin??"0px",root:s.root??null,onVisible:s.onVisible,onHidden:s.onHidden},this.intersectionObserver=null,this.visibilityChangeHandler=null,this.isVisible=!1,this.isPageVisible="undefined"==typeof document||!document.hidden,this.setupIntersectionObserver(),this.setupPageVisibility()}setupIntersectionObserver(){if("undefined"==typeof window||void 0===window.IntersectionObserver)return this.isVisible=!0,void(this.isPageVisible&&this.options.onVisible&&this.options.onVisible());this.intersectionObserver=new IntersectionObserver(t=>{for(const s of t)s.target===this.container&&(s.isIntersecting?(this.isVisible=!0,this.isPageVisible&&this.options.onVisible&&this.options.onVisible()):(this.isVisible=!1,this.options.onHidden&&this.options.onHidden()))},{threshold:this.options.threshold,rootMargin:this.options.rootMargin,root:this.options.root||null}),this.intersectionObserver.observe(this.container)}setupPageVisibility(){"undefined"!=typeof document&&(this.visibilityChangeHandler=()=>{const t=this.isPageVisible;this.isPageVisible=!document.hidden,document.hidden?this.options.onHidden&&this.options.onHidden():t!==this.isPageVisible&&this.isVisible&&this.options.onVisible&&this.options.onVisible()},document.addEventListener("visibilitychange",this.visibilityChangeHandler),document.hidden&&this.isVisible&&this.options.onHidden&&this.options.onHidden())}getIsVisible(){return this.isVisible&&this.isPageVisible}updateOptions(t){this.options={...this.options,...t},this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.setupIntersectionObserver()}destroy(){this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.visibilityChangeHandler&&"undefined"!=typeof document&&(document.removeEventListener("visibilitychange",this.visibilityChangeHandler),this.visibilityChangeHandler=null)}}class s{constructor(t,s){if(this.container="string"==typeof t?document.querySelector(t):t,!this.container)throw new Error("Container element not found");if(!s.text)throw new Error("Text is required");this.config={text:s.text,delay:s.delay??.2,duration:s.duration??.6,randomDelay:s.randomDelay??2,threshold:s.threshold??.1,rootMargin:s.rootMargin??"0px",root:s.root??null,triggerOnce:s.triggerOnce??!1,enabled:s.enabled??!0,onStart:s.onStart||null,onComplete:s.onComplete||null},this.visibilityManager=null,this.textElements=[],this.randomPoints=[],this.hasTriggered=!1,this.isActive=!1,this.init()}init(){this.injectStyles(),this.createTextStructure(),this.setupVisibilityManager()}injectStyles(){if(document.getElementById("masoneffect-textspin-styles"))return;const t=document.createElement("style");t.id="masoneffect-textspin-styles",t.textContent="\n .masoneffect-textspin {\n display: inline-block;\n }\n .masoneffect-textspin-char {\n display: inline-block;\n opacity: 0;\n transform: rotateY(90deg);\n }\n .masoneffect-textspin-char.active {\n opacity: 1;\n transform: rotateY(0deg);\n }\n .masoneffect-textspin-char.space {\n width: 0.25em;\n }\n ",document.head.appendChild(t)}createTextStructure(){this.container.innerHTML="",this.textElements=[],this.randomPoints=[];const t=this.config.text.split("");t.forEach(()=>{this.randomPoints.push(Math.random())}),t.forEach((t,s)=>{const i=document.createElement("span");i.className="masoneffect-textspin-char",i.style.transition=`opacity ${this.config.duration}s ease-out, transform ${this.config.duration}s ease-out`," "===t?(i.classList.add("space"),i.innerHTML="&nbsp;"):i.textContent=t,this.container.appendChild(i),this.textElements.push(i)}),this.container.classList.add("masoneffect-textspin")}setupVisibilityManager(){this.visibilityManager=new t(this.container,{threshold:this.config.threshold,rootMargin:this.config.rootMargin,root:this.config.root,onVisible:()=>{this.config.enabled&&(this.config.triggerOnce&&this.hasTriggered||(this.hasTriggered=!0,this.start()))},onHidden:()=>{this.config.enabled&&(this.stop(),this.config.triggerOnce||(this.hasTriggered=!1))}})}start(){if(this.isActive)return;this.isActive=!0,this.config.onStart&&this.config.onStart(),this.textElements.forEach((t,s)=>{const i=this.config.delay+this.randomPoints[s]*this.config.randomDelay;t.style.transitionDelay=`${i}s`,requestAnimationFrame(()=>{t.classList.add("active")})});const t=this.config.delay+this.config.randomDelay+this.config.duration;setTimeout(()=>{this.config.onComplete&&this.config.onComplete()},1e3*t)}stop(){this.isActive&&(this.isActive=!1,this.textElements.forEach(t=>{t.classList.remove("active"),t.style.transitionDelay=""}))}reset(){this.stop(),this.hasTriggered=!1}updateText(t){this.config.text=t,this.createTextStructure(),this.isActive&&this.start()}updateTransitions(){this.textElements.forEach(t=>{t.style.transition=`opacity ${this.config.duration}s ease-out, transform ${this.config.duration}s ease-out`})}updateConfig(t){const s=this.isActive;this.stop(),this.config={...this.config,...t,text:t.text??this.config.text,onStart:t.onStart??this.config.onStart,onComplete:t.onComplete??this.config.onComplete},void 0!==t.text?this.createTextStructure():void 0!==t.duration&&this.updateTransitions(),void 0===t.threshold&&void 0===t.rootMargin&&void 0===t.root||(this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null),this.setupVisibilityManager()),s&&this.config.enabled&&this.start()}destroy(){this.stop(),this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null),this.container.innerHTML="",this.container.classList.remove("masoneffect-textspin")}}export{s as TextSpin,s as default};
1
+ class t{constructor(t,s={}){this.container=t,this.options={threshold:s.threshold??.1,rootMargin:s.rootMargin??"0px",root:s.root??null,onVisible:s.onVisible,onHidden:s.onHidden},this.intersectionObserver=null,this.visibilityChangeHandler=null,this.isVisible=!1,this.isPageVisible="undefined"==typeof document||!document.hidden,this.setupIntersectionObserver(),this.setupPageVisibility()}setupIntersectionObserver(){if("undefined"==typeof window||void 0===window.IntersectionObserver)return this.isVisible=!0,void(this.isPageVisible&&this.options.onVisible&&this.options.onVisible());this.intersectionObserver=new IntersectionObserver(t=>{for(const s of t)s.target===this.container&&(s.isIntersecting?(this.isVisible=!0,this.isPageVisible&&this.options.onVisible&&this.options.onVisible()):(this.isVisible=!1,this.options.onHidden&&this.options.onHidden()))},{threshold:this.options.threshold,rootMargin:this.options.rootMargin,root:this.options.root||null}),this.intersectionObserver.observe(this.container)}setupPageVisibility(){"undefined"!=typeof document&&(this.visibilityChangeHandler=()=>{const t=this.isPageVisible;this.isPageVisible=!document.hidden,document.hidden?this.options.onHidden&&this.options.onHidden():t!==this.isPageVisible&&this.isVisible&&this.options.onVisible&&this.options.onVisible()},document.addEventListener("visibilitychange",this.visibilityChangeHandler),document.hidden&&this.isVisible&&this.options.onHidden&&this.options.onHidden())}getIsVisible(){return this.isVisible&&this.isPageVisible}updateOptions(t){this.options={...this.options,...t},this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.setupIntersectionObserver()}destroy(){this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.visibilityChangeHandler&&"undefined"!=typeof document&&(document.removeEventListener("visibilitychange",this.visibilityChangeHandler),this.visibilityChangeHandler=null)}}class s{constructor(t,s){if(this.container="string"==typeof t?document.querySelector(t):t,!this.container)throw new Error("Container element not found");if(!s.text)throw new Error("Text is required");this.config={text:s.text,delay:s.delay??.2,duration:s.duration??.6,randomDelay:s.randomDelay??2,threshold:s.threshold??.1,rootMargin:s.rootMargin??"0px",root:s.root??null,triggerOnce:s.triggerOnce??!1,enabled:s.enabled??!0,onStart:s.onStart||null,onComplete:s.onComplete||null},this.visibilityManager=null,this.textElements=[],this.randomPoints=[],this.hasTriggered=!1,this.isActive=!1,this.init()}init(){this.injectStyles(),this.createTextStructure(),this.setupVisibilityManager()}injectStyles(){if(document.getElementById("masoneffect-textspin-styles"))return;const t=document.createElement("style");t.id="masoneffect-textspin-styles",t.textContent="\n .masoneffect-textspin {\n display: inline-block;\n }\n .masoneffect-textspin-char {\n display: inline-block;\n opacity: 0;\n transform: rotateY(90deg);\n }\n .masoneffect-textspin-char.active {\n opacity: 1;\n transform: rotateY(0deg);\n }\n .masoneffect-textspin-char.space {\n width: 0.25em;\n }\n ",document.head.appendChild(t)}createTextStructure(){this.container.innerHTML="",this.textElements=[],this.randomPoints=[];const t=this.config.text.split("");t.forEach(()=>{this.randomPoints.push(Math.random())}),t.forEach((t,s)=>{const i=document.createElement("span");i.className="masoneffect-textspin-char",i.style.transition=`opacity ${this.config.duration}s ease-out, transform ${this.config.duration}s ease-out`," "===t?(i.classList.add("space"),i.innerHTML="&nbsp;"):i.textContent=t,this.container.appendChild(i),this.textElements.push(i)}),this.container.classList.add("masoneffect-textspin")}setupVisibilityManager(){this.visibilityManager=new t(this.container,{threshold:this.config.threshold,rootMargin:this.config.rootMargin,root:this.config.root,onVisible:()=>{this.config.enabled&&(this.config.triggerOnce&&this.hasTriggered||(this.hasTriggered=!0,this.start()))},onHidden:()=>{this.config.enabled&&(this.stop(),this.config.triggerOnce||(this.hasTriggered=!1))}})}start(){if(this.isActive)return;this.isActive=!0,this.config.onStart&&this.config.onStart(),this.textElements.forEach((t,s)=>{const i=this.config.delay+this.randomPoints[s]*this.config.randomDelay;t.style.transitionDelay=`${i}s`,requestAnimationFrame(()=>{t.classList.add("active")})});const t=this.config.delay+this.config.randomDelay+this.config.duration;setTimeout(()=>{this.config.onComplete&&this.config.onComplete()},1e3*t)}stop(){this.isActive&&(this.isActive=!1,this.textElements.forEach(t=>{t.classList.remove("active"),t.style.transitionDelay=""}))}reset(){this.stop(),this.hasTriggered=!1}updateText(t){this.config.text=t,this.createTextStructure(),this.isActive&&this.start()}updateTransitions(){this.textElements.forEach(t=>{t.style.transition=`opacity ${this.config.duration}s ease-out, transform ${this.config.duration}s ease-out`})}updateConfig(t){const s=this.isActive;this.config.enabled;const i=void 0!==t.enabled&&t.enabled!==this.config.enabled;(i&&!1===t.enabled||s)&&this.stop(),this.config={...this.config,...t,text:t.text??this.config.text,onStart:t.onStart??this.config.onStart,onComplete:t.onComplete??this.config.onComplete},void 0!==t.text?this.createTextStructure():void 0!==t.duration&&this.updateTransitions(),void 0===t.threshold&&void 0===t.rootMargin&&void 0===t.root||(this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null),this.setupVisibilityManager()),this.config.enabled&&(s||i&&!0===t.enabled)&&this.visibilityManager?.getIsVisible()&&this.start()}destroy(){this.stop(),this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null),this.container.innerHTML="",this.container.classList.remove("masoneffect-textspin")}}export{s as TextSpin,s as default};
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/textSpin/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,qBAAa,QAAQ;IACnB,SAAS,EAAE,WAAW,CAAC;IACvB,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,eAAe,EAAE,SAAS,GAAG,YAAY,GAAG,MAAM,CAAC,CAAC,GAAG;QAC3E,IAAI,EAAE,WAAW,GAAG,IAAI,CAAC;QACzB,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;QACpC,UAAU,EAAE,eAAe,CAAC,YAAY,CAAC,CAAC;KAC3C,CAAC;IACF,iBAAiB,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC5C,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;gBAEN,SAAS,EAAE,WAAW,GAAG,MAAM,EAAE,OAAO,EAAE,eAAe;IAwCrE,IAAI,IAAI,IAAI;IAWZ,YAAY,IAAI,IAAI;IA4BpB,mBAAmB,IAAI,IAAI;IAsC3B,sBAAsB,IAAI,IAAI;IAyB9B,KAAK,IAAI,IAAI;IA6Bb,IAAI,IAAI,IAAI;IAYZ,KAAK,IAAI,IAAI;IAMb,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAWjC,iBAAiB,IAAI,IAAI;IAOzB,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,IAAI;IAoCvD,OAAO,IAAI,IAAI;CAUhB;AAGD,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/textSpin/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,qBAAa,QAAQ;IACnB,SAAS,EAAE,WAAW,CAAC;IACvB,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,eAAe,EAAE,SAAS,GAAG,YAAY,GAAG,MAAM,CAAC,CAAC,GAAG;QAC3E,IAAI,EAAE,WAAW,GAAG,IAAI,CAAC;QACzB,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;QACpC,UAAU,EAAE,eAAe,CAAC,YAAY,CAAC,CAAC;KAC3C,CAAC;IACF,iBAAiB,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC5C,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;gBAEN,SAAS,EAAE,WAAW,GAAG,MAAM,EAAE,OAAO,EAAE,eAAe;IAwCrE,IAAI,IAAI,IAAI;IAWZ,YAAY,IAAI,IAAI;IA4BpB,mBAAmB,IAAI,IAAI;IAsC3B,sBAAsB,IAAI,IAAI;IAyB9B,KAAK,IAAI,IAAI;IA6Bb,IAAI,IAAI,IAAI;IAYZ,KAAK,IAAI,IAAI;IAMb,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAWjC,iBAAiB,IAAI,IAAI;IAOzB,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,IAAI;IAmDvD,OAAO,IAAI,IAAI;CAUhB;AAGD,eAAe,QAAQ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/textSpin/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,qBAAa,QAAQ;IACnB,SAAS,EAAE,WAAW,CAAC;IACvB,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,eAAe,EAAE,SAAS,GAAG,YAAY,GAAG,MAAM,CAAC,CAAC,GAAG;QAC3E,IAAI,EAAE,WAAW,GAAG,IAAI,CAAC;QACzB,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;QACpC,UAAU,EAAE,eAAe,CAAC,YAAY,CAAC,CAAC;KAC3C,CAAC;IACF,iBAAiB,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC5C,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;gBAEN,SAAS,EAAE,WAAW,GAAG,MAAM,EAAE,OAAO,EAAE,eAAe;IAwCrE,IAAI,IAAI,IAAI;IAWZ,YAAY,IAAI,IAAI;IA4BpB,mBAAmB,IAAI,IAAI;IAsC3B,sBAAsB,IAAI,IAAI;IAyB9B,KAAK,IAAI,IAAI;IA6Bb,IAAI,IAAI,IAAI;IAYZ,KAAK,IAAI,IAAI;IAMb,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAWjC,iBAAiB,IAAI,IAAI;IAOzB,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,IAAI;IAoCvD,OAAO,IAAI,IAAI;CAUhB;AAGD,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/textSpin/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,qBAAa,QAAQ;IACnB,SAAS,EAAE,WAAW,CAAC;IACvB,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,eAAe,EAAE,SAAS,GAAG,YAAY,GAAG,MAAM,CAAC,CAAC,GAAG;QAC3E,IAAI,EAAE,WAAW,GAAG,IAAI,CAAC;QACzB,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;QACpC,UAAU,EAAE,eAAe,CAAC,YAAY,CAAC,CAAC;KAC3C,CAAC;IACF,iBAAiB,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC5C,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;gBAEN,SAAS,EAAE,WAAW,GAAG,MAAM,EAAE,OAAO,EAAE,eAAe;IAwCrE,IAAI,IAAI,IAAI;IAWZ,YAAY,IAAI,IAAI;IA4BpB,mBAAmB,IAAI,IAAI;IAsC3B,sBAAsB,IAAI,IAAI;IAyB9B,KAAK,IAAI,IAAI;IA6Bb,IAAI,IAAI,IAAI;IAYZ,KAAK,IAAI,IAAI;IAMb,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAWjC,iBAAiB,IAAI,IAAI;IAOzB,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,IAAI;IAmDvD,OAAO,IAAI,IAAI;CAUhB;AAGD,eAAe,QAAQ,CAAC"}