PageSourceSearch

https://cerebrium.ai/_astro/SplitTitle.B2QJBP10.js

js cerebrium.ai collected 2026-10-02 04:17:28 UTC 9,205 bytes, 3 lines download raw bytes

vendor: 6,598 bytes, lines 1-3
1import{i as pt}from"./component-manager.modern.DNc_OPSh.js";import{t as K}from"./intersection-observer-manager.modern.BLXhoylW.js";import z from"./index.C4HJ1O9m.js";import{T as tt}from"./Transitions.CDveHI5v.js";let P,M,et=typeof Symbol=="function"?Symbol():"_split",J,ut=()=>J||Z.register(window.gsap),it=typeof Intl<"u"&&"Segmenter"in Intl?new Intl.Segmenter:0,V=t=>typeof t=="string"?V(document.querySelectorAll(t)):"length"in t?Array.from(t).reduce((e,i)=>(typeof i=="string"?e.push(...V(i)):e.push(i),e),[]):[t],st=t=>V(t).filter(e=>e instanceof HTMLElement),Q=[],U=function(){},ct={add:t=>t()},ft=/\s+/g,rt=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"),G={left:0,top:0,width:0,height:0},mt=(t,e)=>{for(;++e<t.length&&t[e]===G;);return t[e]||G},nt=({element:t,html:e,ariaL:i,ariaH:s})=>{t.innerHTML=e,i?t.setAttribute("aria-label",i):t.removeAttribute("aria-label"),s?t.setAttribute("aria-hidden",s):t.removeAttribute("aria-hidden")},ot=(t,e)=>{if(e){let i=new Set(t.join("").match(e)||Q),s=t.length,a,f,r,l;if(i.size)for(;--s>-1;){f=t[s];for(r of i)if(r.startsWith(f)&&r.length>f.length){for(a=0,l=f;r.startsWith(l+=t[s+ ++a])&&l.length<r.length;);if(a&&l.length===r.length){t[s]=r,t.splice(s+1,a);break}}}}return t},at=t=>window.getComputedStyle(t).display==="inline"&&(t.style.display="inline-block"),j=(t,e,i)=>e.insertBefore(typeof t=="string"?document.createTextNode(t):t,i),X=(t,e,i)=>{let s=e[t+"sClass"]||"",{tag:a="div",aria:f="auto",propIndex:r=!1}=e,l=t==="line"?"block":"inline-block",h=s.indexOf("++")>-1,A=S=>{let m=document.createElement(a),E=i.length+1;return s&&(m.className=s+(h?" "+s+E:"")),r&&m.style.setProperty("--"+t,E+""),f!=="none"&&m.setAttribute("aria-hidden","true"),a!=="span"&&(m.style.position="relative",m.style.display=l),m.textContent=S,i.push(m),m};return h&&(s=s.replace("++","")),A.collection=i,A},gt=(t,e,i,s)=>{let a=X("line",i,s),f=window.getComputedStyle(t).textAlign||"left";return(r,l)=>{let h=a("");for(h.style.textAlign=f,t.insertBefore(h,e[r]);r<l;r++)h.appendChild(e[r]);h.normalize()}},lt=(t,e,i,s,a,f,r,l,h,A)=>{var S;let m=Array.from(t.childNodes),E=0,{wordDelimiter:N,reduceWhiteSpace:O=!0,prepareText:Y}=e,q=t.getBoundingClientRect(),R=q,F=!O&&window.getComputedStyle(t).whiteSpace.substring(0,3)==="pre",_=0,b=i.collection,o,c,k,n,g,y,B,d,p,I,C,T,x,W,w,u,L,v;for(typeof N=="object"?(k=N.delimiter||N,c=N.replaceWith||""):c=N===""?"":N||" ",o=c!==" ";E<m.length;E++)if(n=m[E],n.nodeType===3){for(w=n.textContent||"",O?w=w.replace(ft," "):F&&(w=w.replace(/\n/g,c+`
2`)),Y&&(w=Y(w,t)),n.textContent=w,g=c||k?w.split(k||c):w.match(l)||Q,L=g[g.length-1],d=o?L.slice(-1)===" ":!L,L||g.pop(),R=q,B=o?g[0].charAt(0)===" ":!g[0],B&&j(" ",t,n),g[0]||g.shift(),ot(g,h),f&&A||(n.textContent=""),p=1;p<=g.length;p++)if(u=g[p-1],!O&&F&&u.charAt(0)===`
3`&&((S=n.previousSibling)==null||S.remove(),j(document.createElement("br"),t,n),u=u.slice(1)),!O&&u==="")j(c,t,n);else if(u===" ")t.insertBefore(document.createTextNode(" "),n);else{if(o&&u.charAt(0)===" "&&j(" ",t,n),_&&p===1&&!B&&b.indexOf(_.parentNode)>-1?(y=b[b.length-1],y.appendChild(document.createTextNode(s?"":u))):(y=i(s?"":u),j(y,t,n),_&&p===1&&!B&&y.insertBefore(_,y.firstChild)),s)for(C=it?ot([...it.segment(u)].map(D=>D.segment),h):u.match(l)||Q,v=0;v<C.length;v++)y.appendChild(C[v]===" "?document.createTextNode(" "):s(C[v]));if(f&&A){if(w=n.textContent=w.substring(u.length+1,w.length),I=y.getBoundingClientRect(),I.top>R.top&&I.left<=R.left){for(T=t.cloneNode(),x=t.childNodes[0];x&&x!==y;)W=x,x=x.nextSibling,T.appendChild(W);t.parentNode.insertBefore(T,t),a&&at(T)}R=I}(p<g.length||d)&&j(p>=g.length?" ":o&&u.slice(-1)===" "?" "+c:c,t,n)}t.removeChild(n),_=0}else n.nodeType===1&&(r&&r.indexOf(n)>-1?(b.indexOf(n.previousSibling)>-1&&b[b.length-1].appendChild(n),_=n):(lt(n,e,i,s,a,f,r,l,h,!0),_=0),a&&at(n))};const dt=class ht{constructor(e,i){this.isSplit=!1,ut(),this.elements=st(e),this.chars=[],this.words=[],this.lines=[],this.masks=[],this.vars=i,this.elements.forEach(r=>{var l;i.overwrite!==!1&&((l=r[et])==null||l._data.orig.filter(({element:h})=>h===r).forEach(nt)),r[et]=this}),this._split=()=>this.isSplit&&this.split(this.vars);let s=[],a,f=()=>{let r=s.length,l;for(;r--;){l=s[r];let h=l.element.offsetWidth;if(h!==l.width){l.width=h,this._split();return}}};this._data={orig:s,obs:typeof ResizeObserver<"u"&&new ResizeObserver(()=>{clearTimeout(a),a=setTimeout(f,200)})},U(this),this.split(i)}split(e){return(this._ctx||ct).add(()=>{this.isSplit&&this.revert(),this.vars=e=e||this.vars||{};let{type:i="chars,words,lines",aria:s="auto",deepSlice:a=!0,smartWrap:f,onSplit:r,autoSplit:l=!1,specialChars:h,mask:A}=this.vars,S=i.indexOf("lines")>-1,m=i.indexOf("chars")>-1,E=i.indexOf("words")>-1,N=m&&!E&&!S,O=h&&("push"in h?new RegExp("(?:"+h.join("|")+")","gu"):h),Y=O?new RegExp(O.source+"|"+rt.source,"gu"):rt,q=!!e.ignore&&st(e.ignore),{orig:R,animTime:F,obs:_}=this._data,b;(m||E||S)&&(this.elements.forEach((o,c)=>{R[c]={element:o,html:o.innerHTML,ariaL:o.getAttribute("aria-label"),ariaH:o.getAttribute("aria-hidden")},s==="auto"?o.setAttribute("aria-label",(o.textContent||"").trim()):s==="hidden"&&o.setAttribute("aria-hidden","true");let k=[],n=[],g=[],y=m?X("char",e,k):null,B=X("word",e,n),d,p,I,C;if(lt(o,e,B,y,N,a&&(S||N),q,Y,O,!1),S){let T=V(o.childNodes),x=gt(o,T,e,g),W,w=[],u=0,L=T.map(H=>H.nodeType===1?H.getBoundingClientRect():G),v=G,D;for(d=0;d<T.length;d++)W=T[d],W.nodeType===1&&(W.nodeName==="BR"?((!d||T[d-1].nodeName!=="BR")&&(w.push(W),x(u,d+1)),u=d+1,v=mt(L,d)):(D=L[d],d&&D.top>v.top&&D.left<v.left+v.width-1&&(x(u,d),u=d),v=D));u<d&&x(u,d),w.forEach(H=>{var $;return($=H.parentNode)==null?void 0:$.removeChild(H)})}if(!E){for(d=0;d<n.length;d++)if(p=n[d],m||!p.nextSibling||p.nextSibling.nodeType!==3)if(f&&!S){for(I=document.createElement("span"),I.style.whiteSpace="nowrap";p.firstChild;)I.appendChild(p.firstChild);p.replaceWith(I)}else p.replaceWith(...p.childNodes);else C=p.nextSibling,C&&C.nodeType===3&&(C.textContent=(p.textContent||"")+(C.textContent||""),p.remove());n.length=0,o.normalize()}this.lines.push(...g),this.words.push(...n),this.chars.push(...k)}),A&&this[A]&&this.masks.push(...this[A].map(o=>{let c=o.cloneNode();return o.replaceWith(c),c.appendChild(o),o.className&&(c.className=o.className.trim()+"-mask"),c.style.overflow="clip",c}))),this.isSplit=!0,M&&S&&(l?M.addEventListener("loadingdone",this._split):M.status==="loading"&&console.warn("SplitText c
3alled before fonts loaded")),(b=r&&r(this))&&b.totalTime&&(this._data.anim=F?b.totalTime(F):b),S&&l&&this.elements.forEach((o,c)=>{R[c].width=o.offsetWidth,_&&_.observe(o)})}),this}kill(){let{obs:e}=this._data;e&&e.disconnect(),M?.removeEventListener("loadingdone",this._split)}revert(){var e,i;if(this.isSplit){let{orig:s,anim:a}=this._data;this.kill(),s.forEach(nt),this.chars.length=this.words.length=this.lines.length=s.length=this.masks.length=0,this.isSplit=!1,a&&(this._data.animTime=a.totalTime(),a.revert()),(i=(e=this.vars).onRevert)==null||i.call(e,this)}return this}static create(e,i){return new ht(e,i)}static register(e){P=P||e||window.gsap,P&&(V=P.utils.toArray,U=P.core.context||U),!J&&window.innerWidth>0&&(M=document.fonts,J=!0)}};dt.version="3.14.2";let Z=dt;z.registerPlugin(Z);const wt=.35;class St extends HTMLElement{readyObserver=null;splitInstance=null;wordSpans=[];animationStarted=!1;isInView=!1;titleEl=null;constructor(){super()}connectedCallback(){const e=this.querySelector("h1, h2, h3, p");!e||!(e instanceof HTMLElement)||(this.titleEl=e,this.split(),this.wordSpans.length!==0&&(document.documentElement.classList.contains(tt.READY_CLASS)||(this.readyObserver=new MutationObserver(()=>{this.tryStartAnimation()}),this.readyObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]})),K.observe(this,(i,s)=>{this.isInView=s,this.tryStartAnimation()}),this.tryStartAnimation()))}disconnectedCallback(){this.readyObserver?.disconnect(),this.readyObserver=null,K.unobserve(this),this.wordSpans.length>0&&z.killTweensOf(this.wordSpans),this.splitInstance?.revert(),this.splitInstance=null,this.wordSpans=[]}split(){this.titleEl&&(this.splitInstance?.revert(),this.splitInstance=Z.create(this.titleEl,{type:"words",wordsClass:"word",wordsTag:"span"}),this.wordSpans=this.splitInstance.words??[])}tryStartAnimation(){this.animationStarted||!this.isInView||this.wordSpans.length===0||document.documentElement.classList.contains(tt.READY_CLASS)&&(this.readyObserver?.disconnect(),this.readyObserver=null,this.runAnimation())}runAnimation(){if(this.animationStarted||this.wordSpans.length===0)return;this.animationStarted=!0,K.unobserve(this);const e=0,i=.1,s=.032,a=.06;z.set(this,{opacity:1}),z.set(this.wordSpans,{opacity:e}),z.timeline({delay:wt}).to(this.wordSpans,{opacity:1,duration:i,stagger:{each:s,from:"random"},ease:"power2.out"}).to(this.wordSpans,{opacity:.1,duration:a/2,ease:"power1.in"},"+=0.02").to(this.wordSpans,{opacity:1,duration:a/2,ease:"power1.out"})}}customElements.define("c-split-title",pt(St,"SplitTitle"));export{St as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.