!function(t){var r={};function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:n})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,r){if(1&r&&(t=e(t)),8&r)return t;if(4&r&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&r&&"string"!=typeof t)for(var o in t)e.d(n,o,function(r){return t[r]}.bind(null,o));return n},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},e.p="",e(e.s=4)}([function(t,r,e){"use strict";var n,o=this&&this.__extends||(n=function(t,r){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])})(t,r)},function(t,r){function e(){this.constructor=t}n(t,r),t.prototype=null===r?Object.create(r):(e.prototype=r.prototype,new e)});Object.defineProperty(r,"__esModule",{value:!0});var a=function(t){function r(r){var e=t.call(this,r)||this;return e.name="ValidationError",e.message=r,e}return o(r,t),r}(Error);r.ValidationError=a},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["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","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"];r.decode83=function(t){for(var r=0,e=0;e{const{seq:r,imageData:e}=t.data,a=Object(n.encode)(e.data,e.width,e.height,e.width>=e.height?4:3,e.height>=e.width?4:3);o.postMessage({seq:r,blurhash:a})})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e(1),o=e(2),a=e(0),i=function(t){if(!t||t.length<6)throw new a.ValidationError("The blurhash string must be at least 6 characters");var r=n.decode83(t[0]),e=Math.floor(r/9)+1,o=r%9+1;if(t.length!==4+2*o*e)throw new a.ValidationError("blurhash length mismatch: length is "+t.length+" but it should be "+(4+2*o*e))};r.isBlurhashValid=function(t){try{i(t)}catch(t){return{result:!1,errorReason:t.message}}return{result:!0}};var u=function(t){var r=t>>16,e=t>>8&255,n=255&t;return[o.sRGBToLinear(r),o.sRGBToLinear(e),o.sRGBToLinear(n)]},s=function(t,r){var e=Math.floor(t/361),n=Math.floor(t/19)%19,a=t%19;return[o.signPow((e-9)/9,2)*r,o.signPow((n-9)/9,2)*r,o.signPow((a-9)/9,2)*r]};r.default=function(t,r,e,a){i(t),a|=1;for(var f=n.decode83(t[0]),c=Math.floor(f/9)+1,l=f%9+1,h=(n.decode83(t[1])+1)/166,d=new Array(l*c),M=0;M9||u<1||u>9)throw new a.ValidationError("BlurHash must have between 1 and 9 components");if(r*e*4!==t.length)throw new a.ValidationError("Width and height must match the pixels array");for(var s=[],f=function(n){for(var a=function(a){var i=0==a&&0==n?1:2,u=function(t,r,e,n){for(var a=0,i=0,u=0,s=4*r,f=0;f0){var g=Math.max.apply(Math,M.map((function(t){return Math.max.apply(Math,t)}))),b=Math.floor(Math.max(0,Math.min(82,Math.floor(166*g-.5))));l=(b+1)/166,v+=n.encode83(b,1)}else l=1,v+=n.encode83(0,1);return v+=n.encode83((h=d,(o.linearTosRGB(h[0])<<16)+(o.linearTosRGB(h[1])<<8)+o.linearTosRGB(h[2])),4),M.forEach((function(t){v+=n.encode83(function(t,r){return 19*Math.floor(Math.max(0,Math.min(18,Math.floor(9*o.signPow(t[0]/r,.5)+9.5))))*19+19*Math.floor(Math.max(0,Math.min(18,Math.floor(9*o.signPow(t[1]/r,.5)+9.5))))+Math.floor(Math.max(0,Math.min(18,Math.floor(9*o.signPow(t[2]/r,.5)+9.5))))}(t,l),2)})),v}}]); //# sourceMappingURL=df68b9f4f43f094f5acf.worker.js.map