1class c extends HTMLElement{static#d=0;#s={more:"Read More",less:"Read Less"};#e=!1;#i="";#r=2;#h=!1;#t=null;#l=null;#n=null;constructor(){super(),this.id=`read-more-${c.#d++}`,this.#i=this.innerHTML.trim(),this.#r=Number(this.dataset.indent)||2,this.#h=JSON.parse(this.dataset.inline??"false"),this.#s.more=this.dataset.labelMore??this.#s.more,this.#s.less=this.dataset.labelLess??this.#s.less}connectedCallback(){this.render(),this.#n=new ResizeObserver(()=>this.#c()),this.#n.observe(this)}disconnectedCallback(){this.#n?.disconnect(),this.#n=null,this.#t?.removeEventListener("click",this.#o)}#c(){this.#e||this.render()}render(){this.innerHTML=this.#i;const s=Number(getComputedStyle(this).webkitLineClamp);this.scrollHeight>this.offsetHeight?(this.#t||this.#u(),this.#h?this.#f(s):this.#t&&this.insertAdjacentElement("afterend",this.#t)):(this.#t?.remove(),this.#t=null),this.#e||this.#a(!0)}#u(){this.#t=document.createElement("button"),this.#t.className="button-underline-faint",this.#t.textContent=this.#s.more,this.#t.setAttribute("type","button"),this.#t.setAttribute("aria-controls",this.id),this.#t.setAttribute("aria-expanded",String(this.#e)),this.#l=()=>this.#o(),this.#t.addEventListener("click",this.#l)}#f(s){const h=document.createTreeWalker(this,NodeFilter.SHOW_TEXT),i=[];for(;h.nextNode();)i.push(h.currentNode);if(!i.length)return;let t=1,l=null;const o=document.createRange(),n=[];i.forEach(e=>{let r=0;(e.textContent?.trim().split(/\s+/).filter(Boolean)||[]).forEach(d=>{o.setStart(e,r),o.setEnd(e,r+d.length);const u=o.getBoundingClientRect();
1l!==null&&u.top>l&&t++,n.push({index:n.length,node:e,startOffset:r,word:d,line:t}),l=u.top,r+=d.length+1})});const a=n.find(({line:e})=>e===s);if(!a||a.index+this.#r>=n.length)return;const f=a.index+this.#r,b=this.#i.trim().split(/\s+/);this.innerHTML=`${b.slice(0,f).join(" ")}... `,this.#t&&this.appendChild(this.#t)}#o(){this.#e=!this.#e,this.#t&&(this.toggleAttribute("expanded"),this.#t.setAttribute("aria-expanded",String(this.#e)),this.#t.textContent=this.#e?this.#s.less:this.#s.more,this.#e?(this.innerHTML=this.#i,this.#h&&this.appendChild(this.#t),this.#a(!1)):this.render())}#a(s){this.querySelectorAll("a, button, [tabindex]:not(slot)").forEach(t=>{t!==this.#t&&(s?t.setAttribute("tabindex","-1"):t.removeAttribute("tabindex"))})}}customElements.get("read-more")||customElements.define("read-more",c);
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.