1function escapeHtml(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}async function loadWidget({handle:e,feed:t,theme:n,lang:s,pin:i,rp:o,thread:a,ui:r,prof:l}){const d=new URLSearchParams({handle:e,feed:t,theme:n,lang:s,pin:i,rp:o,thread:a,ui:r,prof:l}),c=`https://blueskytimeline.com/v2/widget/?${d.toString()}`;try{const e=await fetch(c,{method:"GET",headers:{Accept:"application/json"}});if(!e.ok)throw new Error(`[BlueskyTimline] HTTP Error: ${e.status} ${e.statusText}`);const t=await e.json().catch(e=>{throw new Error("[BlueskyTimline] Failed to parse JSON: "+e.message)});if(!t||"string"!=typeof t.html)throw new Error('[BlueskyTimline] The response does not contain "html".');return t.html}catch(e){return console.error("[BlueskyTimline] An error occurred while retrieving the widget:",e),null}}import Hls from"/v2/widget/lib/hls.light.mjs";let widgetTag;window.timeline_output=function(){if(widgetTag=document.querySelector("bst-widget"),widgetTag)if((widgetTag.dataset.feed||widgetTag.dataset.handle)&&widgetTag.dataset.theme&&widgetTag.dataset.width&&widgetTag.dataset.height){class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.render()}async render(){let e="",t="";this.dataset.handle&&(e=escapeHtml(this.dataset.handle)),this.dataset.feed&&(t=escapeHtml(this.dataset.feed));const n=escapeHtml(this.dataset.theme),s=escapeHtml(this.dataset.width),i=escapeHtml(this.dataset.height);let o,a="ja",r="false",l="false",d="false",c="0",h="0";if(this.dataset.lang&&(a=escapeHtml(this.dataset.lang)),this.dataset.pin&&(r=escapeHtml(this.dataset.pin)),this.dataset.rp&&(l=escapeHtml(this.dataset.rp)),this.dataset.thread&&(d=escapeHtml(this.dataset.thread)),this.dataset.ui&&(c=escapeHtml(this.dataset.ui)),this.dataset.prof&&(h=escapeHtml(this.dataset.prof)),this.shadowRoot.innerHTML="","light"==n)o="50, 50, 50";else if("dark"==n)o="238, 238, 238";else{const e=widgetTag.dataset.color||"",t=e.split("/").map(e=>e.trim());if(t[0]){o=t[0];const e=this.hexToRgb(o);o=`${e.r}, ${e.g}, ${e.b}`}else o="50, 50, 50"}let p=document.getElementById("bst-widget-style");p||(p=document.createElement("style"),p.id="bst-widget-style",document.head.appendChild(p)),p.textContent=`\n bst-widget {\n border: 1px solid rgba(${o}, 0.2);\n display: block;\n border-radius: 8px;\n overflow: hidden;\n width: 100%;\n max-width: ${s};\n height: ${i};\n }\n `;const m=["#3c3c3c","#FFFFFF","#787878"],u=this.dataset.color||"",f=u.split("/").map(e=>e.trim()),g=[0,1,2].map(e=>{const t=f[e];return this.isValidHex(t)?t:m[e]}),b=g.map(e=>this.hexToRgb(e)),w=document.createElement("style");w.textContent=`\n :host {\n --bs_timeline_box_font-size: 15px;\n --bs_timeline_box_bghover: 120, 120, 120;\n --bs_timeline_box_bg_date: rgba(120, 120, 120, 0.3);\n --bs_timeline_box_color: ${b[0].r}, ${b[0].g}, ${b[0].b};\n --bs_timeline_box_background: ${f[1]||m[1]};\n --bs_timeline_box_href: ${b[2].r}, ${b[2].g}, ${b[2].b};\n --bs_timeline_box_width: ${s};\n --bs_timeline_box_height: ${i};\n }\n :host { position: relative; display: block; }\n `,this.shadowRoot.innerHTML="",this.shadowRoot.appendChild(w);const y=document.createElement("style");y.textContent="\n #bst-loader {\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 9999;\n transition: opacity 0.3s ease 0.3s;\n }\n #bst-loader.hide {\n opacity: 0;\n pointer-events: none;\n }\n .bst-spinner {\n width: 32px;\n height: 32px;\n border: 3px solid rgba(var(--bs_timeline_box_color), 0.15);\n border-top-color: rgba(var(--bs_timeline_box_color), 0.8);\n border-radius: 50%;
1\n animation: bst-spin 0.7s linear infinite;\n }\n @keyframes bst-spin {\n to { transform: rotate(360deg); }\n }\n #bst-content-wrapper {\n opacity: 0;\n transition: opacity 0.3s ease 0.3s;\n width: 100%;\n height: 100%;\n }\n #bst-content-wrapper.visible {\n opacity: 1;\n }\n ",this.shadowRoot.appendChild(y);const _=document.createElement("div");_.id="bst-loader",_.innerHTML='<div class="bst-spinner"></div>',this.shadowRoot.appendChild(_);const v=document.createElement("div");v.id="bst-content-wrapper",this.shadowRoot.appendChild(v),loadWidget({handle:e||"",feed:e?"":t,theme:n,lang:a,pin:r,rp:l,thread:d,ui:c,prof:h}).then(e=>{if(e){v.innerHTML=e;const n=Array.from(this.shadowRoot.querySelectorAll('link[rel="stylesheet"]')),s=()=>{_.classList.add("hide"),v.classList.add("visible"),_.addEventListener("transitionend",()=>_.remove(),{once:!0})};if(0===n.length)requestAnimationFrame(()=>requestAnimationFrame(s));else{let e=0;const t=()=>{e++,e>=n.length&&s()};n.forEach(e=>{e.sheet?t():(e.addEventListener("load",t,{once:!0}),e.addEventListener("error",t,{once:!0}))})}const i=this.shadowRoot.querySelectorAll("video");i.length>0&&i.forEach(e=>{const t=e.getAttribute("data-src")||e.src;t&&this.initHls(e,t)});const o=this.shadowRoot.querySelectorAll(".gif");if(o.length>0){const e=new IntersectionObserver(e=>{e.forEach(e=>{const t=e.target,n=t.querySelector("video");n&&(e.isIntersecting?(n.readyState<2?n.addEventListener("loadedmetadata",()=>{n.paused&&n.play().catch(()=>{})},{once:!0}):n.paused&&n.play().catch(()=>{}),t.classList.add("play")):(n.paused||n.pause(),t.classList.remove("play")))})},{root:this.shadowRoot.querySelector("#bs_timeline_box"),threshold:.25});o.forEach(t=>e.observe(t)),o.forEach(e=>{const t=e.querySelector("video");t&&e.addEventListener("click",()=>{t.paused?(t.play().catch(()=>{}),e.classList.add("play")):(t.pause(),e.classList.remove("play"))})})}const a=matchMedia("(pointer: fine)").matches,r=this;a&&r.shadowRoot.querySelectorAll(".bs_timeline_img_gallery").forEach(e=>{function t(){null!==f&&(cancelAnimationFrame(f),f=null)}function n(){g=0,Array.from(e.children).forEach(e=>{e.style.transform=""})}function s(){return e.scrollLeft<=0}function i(){return e.scrollLeft>=e.scrollWidth-e.clientWidth-1}e.style.touchAction="none",e.classList.add("no-snap");e.closest(".bs_timeline_embed_repost");const o=r.shadowRoot.querySelector(".bst-widget");let a=!!o&&o.clientWidth>397;const l=new ResizeObserver(()=>{a=!!o&&o.clientWidth>397});o&&(l.observe(o),requestAnimationFrame(()=>{a=o.clientWidth>397}));let d,c,h=!1,p=!1,m=0,u=[],f=null,g=0;const b=.36,w=.18,y=80;e.addEventListener("pointerdown",s=>{s.preventDefault(),t(),n(),h=!0,p=!1,e.setPointerCapture(s.pointerId),d=s.clientX,c=performance.now(),m=0,u=[]}),e.addEventListener("pointermove",t=>{if(!h)return;t.preventDefault();const n=t.clientX,o=n-d;Math.abs(o)>2&&(p=!0);const a=s(),r=i();if(o>0&&a){const t=Math.min(g+o*b,y);Array.from(e.children).forEach(e=>{e.style.transform=`translateX(${t}px)`}),g=t}else if(o<0&&r){const t=Math.min(g+Math.abs(o)*b,y);Array.from(e.children).forEach(e=>{e.style.transform=`translateX(-${t}px)`}),g=t}else e.scrollLeft-=o;const l=performance.now(),f=l-c;f>0&&(u.push(o/f),u.length>5&&u.shift(),m=u.reduce((e,t)=>e+t,0)/u.length),d=n,c=l}),e.addEventListener("pointerup",t=>{if(h=!1,e.hasPointerCapture(t.pointerId)&&e.releasePointerCapture(t.pointerId),p){if(g>0){const t=e.scrollLeft<=0?"start":"end";let i=g;function s(){if(i*=1-w,i<.5)return n(),void(f=null);"start"===t?(Array.from(e.children).forEach(e=>{e.style.transform=`translateX(${i}px)`}),g=i):(Array.from(e.children).forEach(e=>{e.style.transform=`translateX(-${i}px)`}),g=i),f=requestAnimationFrame(s)}s()}else{let t=18*m;const n=.9;function i(){Math.abs(t)<.3?f=null:(e.scrollLeft-=t,t>0&&e.scrollLeft<=0||t<0&&e.scrollLeft>=e.scrollWidth-e.clientWidth-1?f=null:(t*=n,f=requestAnimationFrame(i)))}i()}p=!1}else p=!1}),e.addEventListener("pointerleave",s=>{e.hasPointerCapture(s.pointerId)||(t(),n(),h=!1,p=!1)})});let l,d=!1;a&&r.shadowRoot.querySelectorAll(".bs_timeline_img_gallery").forEach(e
1=>{e.addEventListener("pointerdown",()=>{d=!1}),e.addEventListener("pointermove",()=>{d=!0}),e.addEventListener("pointerup",()=>{setTimeout(()=>{d=!1},100)})}),l="2"===c?r.shadowRoot.querySelectorAll(".bs_timeline_embed_repost"):r.shadowRoot.querySelectorAll("#bs_timeline_box section,.bs_timeline_embed_repost");for(let e in l)l.hasOwnProperty(e)&&l[e].addEventListener("click",e=>{if(a&&d)return e.preventDefault(),void e.stopPropagation();if("video"===e.target.tagName.toLowerCase())e.stopPropagation();else{var t=e.currentTarget.getAttribute("post_uri");window.open(t,"_blank")}});var t=r.shadowRoot.querySelectorAll("#bs_timeline_box a,.bs_timeline_embed_repost");for(let e in t)t.hasOwnProperty(e)&&t[e].addEventListener("click",e=>{if(a&&d)return e.preventDefault(),void e.stopPropagation();e.stopPropagation()})}else this.shadowRoot.innerHTML+='<div class="error">Failed to load</div>'})}isValidHex(e){return/^#([0-9a-fA-F]{6})$/.test(e)}hexToRgb(e){const t=e.replace("#",""),n=parseInt(t,16);return{r:n>>16&255,g:n>>8&255,b:255&n}}initHls(e,t){if(Hls.isSupported()){const n=new Hls;n.loadSource(t),n.attachMedia(e)}else e.canPlayType("application/vnd.apple.mpegurl")&&(e.src=t)}}customElements.get("bst-widget")||customElements.define("bst-widget",e)}else console.error('[BlueskyTimline] Attribute not found required to load "timeline.js".')},"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{requestIdleCallback(()=>timeline_output(),{timeout:2e3})}):timeline_output();
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.