1!function(){var e;if(void 0===t)var t={windows:0,mac:1,linux:2,unix:3};switch(windows=-1!=navigator.userAgent.indexOf("Windows",0)?1:0,mac=-1!=navigator.userAgent.indexOf("Mac",0)?1:0,linux=-1!=navigator.userAgent.indexOf("Linux",0)?1:0,unix=-1!=navigator.userAgent.indexOf("X11",0)?1:0,windows?e=t.windows:mac?e=t.mac:linux?e=t.linux:unix&&(e=t.unix),e){case t.windows:break;case t.mac:document.body.className="mac";case t.linux:}function n(){console.log("Initializing gallery sliders");const e=document.querySelectorAll(".entry-content figure.wp-block-gallery");console.log("Found",e.length,"galleries"),e.forEach(e=>{const t=e.querySelectorAll("figure");console.log("Gallery has",t.length,"figures"),t.length>1&&function(e,t){console.log("Creating slider for gallery with",t.length,"figures"),e.classList.add("slider-initialized");const n=document.createElement("div");n.className="gallery-slider";const o=document.createElement("div");o.className="gallery-slider-container";const i=t[0]?.querySelector("img");i&&function(e,t){function n(){let n=600;if(e.parentElement&&e.parentElement.offsetWidth>0)n=e.parentElement.offsetWidth;else if(e.offsetWidth>0)n=e.offsetWidth;else{const e=document.querySelector("#content");n=e&&e.offsetWidth>0?e.offsetWidth:Math.min(600,.9*window.innerWidth)}if(console.log(`Using container width: ${n}px`),t.naturalWidth&&t.naturalHeight){const o=t.naturalHeight/t.naturalWidth,i=n*o,s=200,a=Math.min(800,.7*window.innerHeight),c=Math.max(s,Math.min(a,i));e.style.height=`${c}px`,console.log(`Set gallery height to ${c}px based on aspect ratio ${o.toFixed(2)}`)}else{const o=new Image;o.onload=function(){const t=this.height/this.width,o=n*t,i=200,s=Math.min(800,.7*window.innerHeight),a=Math.max(i,Math.min(s,o));e.style.height=`${a}px`,console.log(`Set gallery height to ${a}px after image load`)},o.src=t.src}}setTimeout(()=>{n()},100);const o=new ResizeObserver(()=>{n()}),i=e.parentElement||document.body;o.observe(i)}(n,i);t.forEach((e,t)=>{const n=document.createElement("div");n.className="gallery-slide";const i=e.querySelector("img");i&&n.appendChild(i.cloneNode(!0)),o.appendChild(n)}),n.appendChild(o);const s=document.createElement("button");s.className="gallery-nav-btn prev",s.innerHTML="â¹";const a=document.createElement("button");a.className="gallery-nav-btn next",a.innerHTML="âº",n.appendChild(s),n.appendChild(a);const c=document.createElement("div");c.className="gallery-pagination";for(let e=0;e<t.length;e++){const t=document.createElement("div");t.className="gallery-pagination-dot"+(0===e?" active":""),c.appendChild(t)}n.appendChild(c),e.innerHTML="",e.appendChild(n),console.log("Gallery slider created with",t.length,"slides");let l=0;const r=o.querySelectorAll(".gallery-slide"),d=c.querySelectorAll(".gallery-pagination-dot");function u(){o.style.transform=`translateX(-${100*l}%)`,d.forEach((e,t)=>{e.classList.toggle("active",t===l)})}function m(){console.log("Next slide clicked"),l<r.length-1&&(l++,u())}function g(){console.log("previous slide clicked"),l>0&&(l--,u())}console.log("Adding event listeners to navigation buttons"),a.addEventListener("click",m),s.addEventListener("click",g),console.log("Navigation buttons event listeners added"),d.forEach((e,t)=>{e.addEventListener("click",()=>{l=t,u()})});let p=0,f=0,h=0,v=!1,y=!1,L=0;n.addEventListener("touchstart",e=>{p=e.touches[0].clientX,f=e.touches[0].clientY,h=p,v=!0,y=!1,L=100*-l,o.style.transition="none"}),n.addEventListener("touchmove",e=>{if(!v)return;h=e.touches[0].clientX;const t=e.touches[0].clientY,i=p-h,s=f-t,a=i/n.offsetWidth*100;if(!y&&(Math.abs(i)>3||Math.abs(s)>3)&&(y=Math.abs(i)>Math.abs(s)),y&&e.preventDefault(),y){let e=L-a;const t=100*-(r.length-1),n=0;if(e>n){e=n+.3*(e-n)}else if(e<t){e=t-.3*(t-e)}o.style.transform=`translateX(${e}%)`}}),n.addEventListener("touchend",e=>{if(v)if(v=!1,y){const e=p-h,t=n.offsetWidth,i=100*Math.abs(e/t);o.style.transition="transform 0.3s ease-out";const s=30,a=Math.abs(e);i>s||a>50?e>0?l<r.length-1?m():u():l>0?g():u():u()}else o.style.transition="transform 0.3s ease-out",u()})}(e,t)})}function o(){const e=document.querySelector(".menu-toggle"),t=document.querySelector("nav.blog_category"),n=document.body;if(!e||!t)return;e.addEventListener("click",function(o){o.stopPropagation(),e.classList.toggle("active"),t.classList.toggle("active"),n.classList.toggle("menu-open")}),document.addEventListener("click",function(o){t.contains(o.target)||e.contains(o.target)||(e.classList.remove("active"),t.classList.remove("active"),n.classList.remove("menu-open"))});t.querySelectorAll("a").forEach(o=>{o.addEventListener("click",function(){e.classList.remove("active"),t.classList.remove("active"),n.classList.remove("menu-open")})}),document.addEventListener("touchmove",function(e){n.classList.contains("menu-open")&&e.preventDefault()},{passive:!1})}function i(){const e=document.querySelectorAll(".search-toggle"),t=document.querySelectorAll(".search-box");0!==e.length&&0!==t.length&&(e.forEach((e,n)=>{const o=e.nextElementSibling;if(!o||!o.classList.contains("search-box"))return;const i=o.querySelector('input[type="search"]'),s=o.querySelector("form");e.addEventListener("click",function(n){n.stopPropagation(),t.forEach(e
1=>{if(e!==o){e.classList.remove("active");const t=e.previousElementSibling;t&&t.classList.contains("search-toggle")&&t.classList.remove("hidden")}}),o.classList.toggle("active");e.closest(".mobile-search-item")&&(o.classList.contains("active")?e.classList.add("hidden"):e.classList.remove("hidden")),o.classList.contains("active")&&i&&setTimeout(()=>{i.focus()},50)}),s&&i&&s.addEventListener("submit",function(e){""===i.value.trim()&&(e.preventDefault(),i.focus())})}),document.addEventListener("click",function(e){t.forEach(t=>{const n=t.previousElementSibling;t.contains(e.target)||n&&n.contains(e.target)||(t.classList.remove("active"),n&&n.closest(".mobile-search-item")&&n.classList.remove("hidden"))})}),document.addEventListener("keydown",function(e){"Escape"===e.key&&t.forEach(e=>{if(e.classList.contains("active")){e.classList.remove("active");const t=e.previousElementSibling;t&&t.closest(".mobile-search-item")&&t.classList.remove("hidden")}})}))}document.addEventListener("DOMContentLoaded",function(){document.body.classList.remove("entry-content");new MutationObserver(e=>{e.forEach(e=>{"attributes"===e.type&&"class"===e.attributeName&&document.body.classList.contains("entry-content")&&document.body.classList.remove("entry-content")})}).observe(document.body,{attributes:!0,attributeFilter:["class"]}),n(),window.addEventListener("load",n),function(){const e=document.querySelector(".header-nav");if(!e)return;let t=!1;function n(){(window.pageYOffset||document.documentElement.scrollTop)>10?e.classList.add("scrolled"):e.classList.remove("scrolled"),t=!1}function o(){t||(requestAnimationFrame(n),t=!0)}window.addEventListener("scroll",o,{passive:!0}),n()}()}),function(){const e=document.getElementById("disqus_thread");if(e){const t=e.querySelector("iframe");t&&(t.style.display="none")}const t=decodeURI(window.location.pathname),n=Array.from(document.querySelectorAll(".popular-tags-container li"));if(t.startsWith("/post/tag/")){const e=t.split("/post/tag/");if(e.length>1){let t=e[1];"æ¯å¨è¯»ä¹¦"==t&&(t="æ«å½±å¤è¯»");let o="";n.forEach(e=>{e.classList.remove("active"),e.textContent.trim().includes(t)&&(e.classList.add("active"),o=t)}),0==o.length&&(o=t);const i=document.getElementById("recently-updated");i&&(i.innerHTML=`<i class="fa fa-tags"></i> ${o}`)}const o=document.getElementById("index-intro");o&&(o.style.display="none")}else{const e=document.getElementById("index-intro");e&&(e.style.display="block")}}(),function e(){if("undefined"==typeof plausible)return void setTimeout(e,100);let t={25:!1,50:!1,75:!1,100:!1};function n(){const e=window.pageYOffset||document.documentElement.scrollTop,n=document.documentElement.scrollHeight-document.documentElement.clientHeight,o=Math.round(e/n*100);Object.keys(t).forEach(e=>{o>=parseInt(e)&&!t[e]&&(t[e]=!0,"100"===e?plausible("Article Read",{props:{title:document.title,path:window.location.pathname}}):plausible("Scroll Depth",{props:{depth:e+"%",title:document.title}}))})}if(document.body.classList.contains("single-post")||document.querySelector(".entry-content")){let e;window.addEventListener("scroll",function(){clearTimeout(e),e=setTimeout(n,100)},{passive:!0})}function o(){document.querySelectorAll("audio").forEach(e=>{let t=!1,n=0;e.addEventListener("play",function(){if(!t){t=!0;const n=e.closest("figure")?.querySelector("figcaption")?.textContent||e.getAttribute("title")||e.getAttribute("data-title")||document.title||"Unknown Audio";plausible("Podcast Play",{props:{title:n,url:e.src}})}}),e.addEventListener("ended",function(){const t=e.closest("figure")?.querySelector("figcaption")?.textContent||e.getAttribute("title")||e.getAttribute("data-title")||document.title||"Unknown Audio";plausible("Podcast Complete",{props:{title:t,url:e.src}})}),e.addEventListener("timeupdate",function(){if(e.duration){const t=Math.round(e.currentTime/e.duration*100);[25,50,75].forEach(o=>{if(t>=o&&n<o){const t=e.closest("figure")?.querySelector("figcaption")?.textContent||e.getAttribute("title")||e.getAttribute("data-title")||document.title||"Unknown Audio";plausible("Podcast Progress",{props:{progress:o+"%",title:t}}),n=o}})}})})}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",o):o(),document.addEventListener("click",function(e){if(e.target.classList.contains("gallery-nav-btn")){const t=e.target.classList.contains("next")?"Next":"Previous";plausible("Gallery Navigation",{props:{action:t,page:document.title}}
1)}e.target.classList.contains("gallery-pagination-dot")&&plausible("Gallery Pagination",{props:{page:document.title}})}),document.addEventListener("click",function(e){const t=e.target.closest("a");if(t&&t.href){const e=new URL(t.href,window.location.href);e.hostname===window.location.hostname||e.hostname.includes("justinyan.me")||plausible("Outbound Link",{props:{url:e.href,domain:e.hostname}})}}),document.addEventListener("click",function(e){if(e.target.closest(".popular-tags-container a")){const t=e.target.closest("a").textContent.trim();plausible("Tag Click",{props:{tag:t,location:"sidebar"}})}if(e.target.closest('.entry-meta a[rel="tag"]')){const t=e.target.closest("a").textContent.trim();plausible("Tag Click",{props:{tag:t,location:"post-meta"}})}}),document.getElementById("disqus_thread")&&function(){const e=setInterval(function(){const t=document.querySelector("#disqus_thread iframe");t&&(clearInterval(e),t.addEventListener("load",function(){plausible("Comments Loaded",{props:{page:document.title}})},{once:!0}),t.addEventListener("mouseenter",function(){plausible("Comment Interaction",{props:{action:"engage",page:document.title}})},{once:!0}))},1e3);setTimeout(()=>clearInterval(e),1e4)}(),document.querySelectorAll('form[role="search"], form.search-form').forEach(e=>{e.addEventListener("submit",function(t){const n=e.querySelector('input[type="search"], input[type="text"]');n&&n.value&&plausible("Site Search",{props:{query:n.value}})})}),document.body.classList.contains("error404")&&plausible("404 Error",{props:{path:window.location.pathname,referrer:document.referrer||"direct"}}),document.addEventListener("click",function(e){const t=e.target.closest("a");if(t&&t.href){const e=["pdf","doc","docx","xls","xlsx","ppt","pptx","zip","rar","mp3","mp4"],n=new URL(t.href,window.location.href),o=n.pathname.split(".").pop().toLowerCase();e.includes(o)&&plausible("File Download",{props:{file:n.pathname.split("/").pop(),type:o}})}})}(),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",o):o(),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",i):i()}();
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.