(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
"use strict";var _blurhash=require("blurhash");const reduceMotion=window.matchMedia("(prefers-reduced-motion: reduce)");function dynamicSpoiler(e,t){Array.from(document.getElementsByClassName(e)).forEach((e=>{const a=t(e);a&&(a(),e.addEventListener("toggle",a))}))}document.querySelectorAll("img[data-object-position]").forEach((e=>{e.style["object-position"]=e.dataset.objectPosition})),Array.from(document.getElementsByClassName("blurhash-container")).forEach((e=>{const t=e.dataset.blurhashHash,a=e.dataset.blurhashHeight,o=e.dataset.blurhashWidth,r=e.dataset.blurhashAspect,n=e.dataset.blurhashObjectPosition;var s=32,i=32;switch(!0){case o>a:i=Math.round(s/r);break;case a>o:s=Math.round(i*r)}const l=(0,_blurhash.decode)(t,s,i),c=document.createElement("canvas");c.width=s,c.height=i;const d=c.getContext("2d"),u=d.createImageData(s,i);u.data.set(l),d.putImageData(u,0,0),n&&(c.style["object-position"]=n),e.appendChild(c)})),Array.from(document.getElementsByTagName("img")).forEach((e=>{if(!e.dataset.blurhashHash)return;if("true"!==e.dataset.sensitive)return;if(e.complete)return;const t=e.closest(".photoswipe-slide");if(!t)return;const a=document.querySelector('div[data-blurhash-hash="'+e.dataset.blurhashHash+'"]');if(!a)return;const o=a.children[0];if(!o)return;const r=o.cloneNode(!0);r.getContext("2d").drawImage(o,0,0),t.prepend(r),e.className=e.className+" hidden";const n=e.closest(".media-spoiler");n.addEventListener("toggle",(t=>{n.hasAttribute("open")&&!e.complete&&(e.loading="eager")})),e.addEventListener("load",(()=>{e.className=e.className.replace(" hidden",""),e.loading="lazy";const a=t.getElementsByTagName("canvas")[0];a&&a.remove()}))}));var textSpoilersCount=0;if(dynamicSpoiler("text-spoiler",(e=>{textSpoilersCount++;const t=e.children[0],a=e.querySelector(".button");return t.tabIndex="-1",a.tabIndex="0",a.setAttribute("aria-role","button"),a.onclick=t=>(t.preventDefault(),e.hasAttribute("open")?e.removeAttribute("open"):e.setAttribute("open","")),a.addEventListener("keydown",(e=>{"Enter"===e.key&&(e.preventDefault(),a.click())})),()=>{a.textContent=e.open?"Show less":"Show more"}})),dynamicSpoiler("media-spoiler",(e=>{const t=e.children[0],a=e.querySelector(".eye.button"),o=e.querySelector(".plyr-video"),r=!reduceMotion.matches&&null!=o&&o.classList.contains("gifv");return t.tabIndex="-1",a.tabIndex="0",a.setAttribute("aria-role","button"),a.onclick=t=>(t.preventDefault(),e.hasAttribute("open")?e.removeAttribute("open"):e.setAttribute("open","")),a.addEventListener("keydown",(e=>{"Enter"===e.key&&(e.preventDefault(),a.click())})),()=>{e.open?a.setAttribute("aria-label","Hide media"):(a.setAttribute("aria-label","Show media"),o&&!r&&o.pause())}})),textSpoilersCount>1){const e=document.getElementById("thread-show-hide-all-toggle-wrapper");if(e){const t="Expand all spoilers",a="Collapse all spoilers",o=document.createElement("button");o.className="thread-show-hide-all-toggle-button",o.textContent=t,o.setAttribute("aria-label",t),o.onclick=e=>{e.preventDefault();const r=o.textContent===t;Array.from(document.getElementsByClassName("text-spoiler")).forEach((e=>{const t=e.querySelector(".button");(r&&!e.open||!r&&e.open&&e.open)&&t.click()})),r?(o.textContent=a,o.setAttribute("aria-label",a)):(o.textContent=t,o.setAttribute("aria-label",t))},o.addEventListener("keydown",(e=>{"Enter"===e.key&&(e.preventDefault(),o.click())})),e.appendChild(o),e.className="",e.ariaHidden=!1}}const dateTimeFormat=Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1});Array.from(document.getElementsByTagName("time")).forEach((e=>{const t=e.getAttribute("datetime");if(e.textContent.trim().match(/\d{2}:\d{2}/)){const a=new Date(t);e.textContent=dateTimeFormat.format(a)}}));

},{"blurhash":2}],2:[function(require,module,exports){
"use strict";var q=Object.defineProperty,U=Object.getOwnPropertyDescriptor,j=Object.getOwnPropertyNames,D=Object.prototype.hasOwnProperty,$=(t,e)=>{for(var r in e)q(t,r,{get:e[r],enumerable:!0})},H=(t,e,r,a)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let h of j(e))!D.call(t,h)&&h!==r&&q(t,h,{get:()=>e[h],enumerable:!(a=U(e,h))||a.enumerable});return t},O=t=>H(q({},"__esModule",{value:!0}),t),_={};$(_,{ValidationError:()=>b,decode:()=>I,encode:()=>F,isBlurhashValid:()=>V}),module.exports=O(_);var C=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],x=t=>{let e=0;for(let r=0;r<t.length;r++){let a=t[r];e=83*e+C.indexOf(a)}return e},p=(t,e)=>{var r="";for(let a=1;a<=e;a++){let h=Math.floor(t)/Math.pow(83,e-a)%83;r+=C[Math.floor(h)]}return r},h=t=>{let e=t/255;return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)},M=t=>{let e=Math.max(0,Math.min(1,t));return e<=.0031308?Math.trunc(12.92*e*255+.5):Math.trunc(255*(1.055*Math.pow(e,.4166666666666667)-.055)+.5)},S=t=>t<0?-1:1,d=(t,e)=>S(t)*Math.pow(Math.abs(t),e),b=class extends Error{constructor(t){super(t),this.name="ValidationError",this.message=t}},A=t=>{if(!t||t.length<6)throw new b("The blurhash string must be at least 6 characters");let e=x(t[0]),r=Math.floor(e/9)+1,a=e%9+1;if(t.length!==4+2*a*r)throw new b(`blurhash length mismatch: length is ${t.length} but it should be ${4+2*a*r}`)},V=t=>{try{A(t)}catch(t){return{result:!1,errorReason:t.message}}return{result:!0}},W=t=>{let e=t>>8&255,r=255&t;return[h(t>>16),h(e),h(r)]},k=(t,e)=>{let r=Math.floor(t/361),a=Math.floor(t/19)%19,h=t%19;return[d((r-9)/9,2)*e,d((a-9)/9,2)*e,d((h-9)/9,2)*e]},J=(t,e,r,a)=>{A(t),a|=1;let h=x(t[0]),l=Math.floor(h/9)+1,o=h%9+1,n=(x(t[1])+1)/166,s=new Array(o*l);for(let e=0;e<s.length;e++)if(0===e){let r=x(t.substring(2,6));s[e]=W(r)}else{let r=x(t.substring(4+2*e,6+2*e));s[e]=k(r,n*a)}let f=4*e,u=new Uint8ClampedArray(f*r);for(let t=0;t<r;t++)for(let a=0;a<e;a++){let h=0,n=0,i=0;for(let M=0;M<l;M++)for(let l=0;l<o;l++){let f=Math.cos(Math.PI*a*l/e)*Math.cos(Math.PI*t*M/r),u=s[l+M*o];h+=u[0]*f,n+=u[1]*f,i+=u[2]*f}let c=M(h),m=M(n),p=M(i);u[4*a+0+t*f]=c,u[4*a+1+t*f]=m,u[4*a+2+t*f]=p,u[4*a+3+t*f]=255}return u},I=J,E=4,K=(t,e,r,a)=>{let l=0,o=0,n=0,s=e*E;for(let M=0;M<e;M++){let e=E*M;for(let f=0;f<r;f++){let r=e+f*s,u=a(M,f);l+=u*h(t[r]),o+=u*h(t[r+1]),n+=u*h(t[r+2])}}let M=1/(e*r);return[l*M,o*M,n*M]},Q=t=>(M(t[0])<<16)+(M(t[1])<<8)+M(t[2]),X=(t,e)=>19*Math.floor(Math.max(0,Math.min(18,Math.floor(9*d(t[0]/e,.5)+9.5))))*19+19*Math.floor(Math.max(0,Math.min(18,Math.floor(9*d(t[1]/e,.5)+9.5))))+Math.floor(Math.max(0,Math.min(18,Math.floor(9*d(t[2]/e,.5)+9.5)))),Z=(t,e,r,a,h)=>{if(a<1||a>9||h<1||h>9)throw new b("BlurHash must have between 1 and 9 components");if(e*r*4!==t.length)throw new b("Width and height must match the pixels array");let l=[];for(let o=0;o<h;o++)for(let h=0;h<a;h++){let a=0==h&&0==o?1:2,n=K(t,e,r,((t,l)=>a*Math.cos(Math.PI*h*t/e)*Math.cos(Math.PI*o*l/r)));l.push(n)}let o,n=l[0],s=l.slice(1),M="";if(M+=p(a-1+9*(h-1),1),s.length>0){let t=Math.max(...s.map((t=>Math.max(...t)))),e=Math.floor(Math.max(0,Math.min(82,Math.floor(166*t-.5))));o=(e+1)/166,M+=p(e,1)}else o=1,M+=p(0,1);return M+=p(Q(n),4),s.forEach((t=>{M+=p(X(t,o),2)})),M},F=Z;

},{}]},{},[1]);
