/*! * SplitText 3.13.0 * https://gsap.com * * @license Copyright 2025, GreenSock. All rights reserved. Subject to the terms at https://gsap.com/standard-license. * @author: Jack Doyle */ (function(O,T){typeof exports=="object"&&typeof module!="undefined"?T(exports):typeof define=="function"&&define.amd?define(["exports"],T):(O=typeof globalThis!="undefined"?globalThis:O||self,T(O.window=O.window||{}))})(this,function(O){"use strict";let T,k,P,Y,Z,ee=()=>Z||z.register(window.gsap),q={},te=e=>{var t;return(t=q[e])==null?void 0:t.slice(0).forEach(i=>i())},K=(e,t)=>{ee(),!k&&e==="fontsLoaded"&&t();let i=q[e]||(q[e]=[]);~i.indexOf(t)||i.push(t)},Q=(e,t)=>{let i=q[e],n=i&&i.indexOf(t);n>=0&&i.splice(n,1)},ue=()=>{P!==window.innerWidth&&(P=window.innerWidth,te("widthChange"))},ie=typeof Intl!="undefined"?new Intl.Segmenter:0,G=e=>typeof e=="string"?G(document.querySelectorAll(e)):"length"in e?Array.from(e):[e],ne=e=>G(e).filter(t=>t instanceof HTMLElement),U=[],V=function(){},ce=/\s+/g,se=new RegExp("\\p{RI}\\p{RI}|\\p{Emoji}(\\p{EMod}|\\u{FE0F}\\u{20E3}?|[\\u{E0020}-\\u{E007E}]+\\u{E007F})?(\\u{200D}\\p{Emoji}(\\p{EMod}|\\u{FE0F}\\u{20E3}?|[\\u{E0020}-\\u{E007E}]+\\u{E007F})?)*|.","gu"),le={left:0,top:0,width:0,height:0},re=(e,t)=>{if(t){let i=new Set(e.join("").match(t)||U),n=e.length,a,u,l,p;if(i.size)for(;--n>-1;){u=e[n];for(l of i)if(l.startsWith(u)&&l.length>u.length){for(a=0,p=u;l.startsWith(p+=e[n+ ++a])&&p.lengthwindow.getComputedStyle(e).display==="inline"&&(e.style.display="inline-block"),M=(e,t,i)=>t.insertBefore(typeof e=="string"?document.createTextNode(e):e,i),X=(e,t,i)=>{let n=t[e+"sClass"]||"",{tag:a="div",aria:u=!0,propIndex:l=!1}=t,p=e==="line"?"block":"inline-block",c=n.indexOf("++")>-1,N=y=>{let f=document.createElement(a),E=i.length+1;return n&&(f.className=n+(c?" "+n+E:"")),l&&f.style.setProperty("--"+e,E+""),u&&f.setAttribute("aria-hidden","true"),a!=="span"&&(f.style.position="relative",f.style.display=p),f.textContent=y,i.push(f),f};return c&&(n=n.replace("++","")),N.collection=i,N},fe=(e,t,i,n)=>{let a=X("line",i,n),u=window.getComputedStyle(e).textAlign||"left";return(l,p)=>{let c=a("");for(c.style.textAlign=u,e.insertBefore(c,t[l]);l{var y;let f=Array.from(e.childNodes),E=0,{wordDelimiter:A,reduceWhiteSpace:R=!0,prepareText:$}=t,J=e.getBoundingClientRect(),B=J,H=!R&&window.getComputedStyle(e).whiteSpace.substring(0,3)==="pre",x=0,r=i.collection,g,_,s,w,v,j,o,h,b,S,L,W,C,D,d,m;for(typeof A=="object"?(_=A.pattern||A,g=A.text||""):g=A===""?"":A||" ";E-1?(v=r[r.length-1],v.appendChild(document.createTextNode(n?"":m))):(v=i(n?"":m),M(v,e,s),x&&h===1&&!j&&v.insertBefore(x,v.firstChild)),n)for(L=ie?re([...ie.segment(m)].map(F=>F.segment),c):m.match(p)||U,b=0;bB.top&&S.left<=B.left){for(W=e.cloneNode(),C=e.childNodes[0];C&&C!==v;)D=C,C=C.nextSibling,W.appendChild(D);e.parentNode.insertBefore(W,e),a&&oe(W)}B=S}(h-1?(r.indexOf(s.previousSibling)>-1&&r[r.length-1].appendChild(s),x=s):(ae(s,t,i,n,a,u,l,p,c,!0),x=0),a&&oe(s))};const de=class pe{constructor(t,i){this.isSplit=!1,ee(),this.elements=ne(t),this.chars=[],this.words=[],this.lines=[],this.masks=[],this._data={orig:[]},this.vars=i,this._split=()=>this.isSplit&&this.split(this.vars),V(this),this.split(i)}split(t){this.isSplit&&this.revert(),this.vars=t=t||this.vars||{};let{type:i="chars,words,lines",aria:n=!0,deepSlice:a=!0,smartWrap:u,onSplit:l,autoSplit:p=!1,specialChars:c,mask:N}=this.vars,y=i.indexOf("lines")>-1,f=i.indexOf("chars")>-1,E=i.indexOf("words")>-1,A=f&&!E&&!y,R=c&&("push"in c?new RegExp("(?:"+c.join("|")+")","gu"):c),$=R?new RegExp(R.source+"|"+se.source,"gu"):se,J=t.ignore?ne(t.ignore):void 0,{orig:B,animTime:H}=this._data,x;return(f||E||y)&&(this.elements.forEach((r,g)=>{B[g]={element:r,html:r.innerHTML,style:r.getAttribute("style")||"",aria:r.getAttribute("aria-label")},n&&r.setAttribute("aria-label",(r.textContent||"").trim());let _=[],s=[],w=[],v=f?X("char",t,_):null,j=X("word",t,s),o,h,b,S;if(ae(r,t,j,v,A,a&&(y||A),J,$,R,!1),y){let L=G(r.childNodes),W=fe(r,L,t,w),C,D=[],d=0,m=L.map(I=>I.nodeType===1?I.getBoundingClientRect():le),F=le;for(o=0;oF.top&&m[o].left<=F.left&&(W(d,o),d=o),F=m[o]));d{var he;return(he=I.parentNode)==null?void 0:he.removeChild(I)})}if(!E){for(o=0;o{let g=r.cloneNode();return r.replaceWith(g),g.appendChild(r),r.className&&(g.className=r.className.replace(/(\b\w+\b)/g,"$1-mask")),g.style.overflow="clip",g}))),this.isSplit=!0,p?(K("fontsLoaded",this._split),y&&K("widthChange",this._split)):k&&k.status==="loading"&&console.warn("SplitText called before fonts loaded"),(x=l&&l(this))&&x.totalTime&&(this._data.anim=H?x.totalTime(H):x),this}revert(){var t,i;let n=this._data;if(!n)throw"revert() improperly scoped";return n.orig.forEach(({element:a,html:u,style:l,aria:p})=>{a.innerHTML=u,a.setAttribute("style",l),p?a.setAttribute("aria-label",p):a.removeAttribute("aria-label")}),this.chars.length=this.words.length=this.lines.length=n.orig.length=this.masks.length=0,this.isSplit=!1,Q("fontsLoaded",this._split),Q("widthChange",this._split),n.anim&&(n.animTime=n.anim.totalTime(),n.anim.revert()),(i=(t=this.vars).onRevert)==null||i.call(t,this),this}static create(t,i){return new pe(t,i)}static register(t){T=T||t||window.gsap,T&&(G=T.utils.toArray,V=T.core.context||V,Z=!0),P||(k=document.fonts,P=window.innerWidth,window.addEventListener("resize",()=>{clearTimeout(Y),Y=setTimeout(ue,200)}),k&&k.ready.then(()=>te("fontsLoaded")))}};de.version="3.13.0";let z=de;z.addEventListener=K,z.removeEventListener=Q,O.SplitText=z,O.default=z,Object.defineProperty(O,"__esModule",{value:!0})});