var tco;(()=>{"use strict";var e={};(e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})})(e);const t={"image-contrast":function({imageData:e}){let{dominant:t}=function(e,t){function n(e){return"transparent"===e||-1!==e.indexOf("rgb")||-1!==e.indexOf("hsl")?e:["rgb(",e,")"].join("")}function r(e,t){return{name:n(e),count:t}}for(var o=(t=t||{}).exclude||[],a=t.paletteSize||10,i={},s="",u=[],c=0;c<e.length;c+=4)u[0]=e[c],u[1]=e[c+1],u[2]=e[c+2],s=u.join(","),-1===u.indexOf(void 0)&&(e[c+3]<85&&(s="transparent"),-1===o.indexOf(n(s))&&(i[s]=s in i?i[s]+1:1));var f=function(e,t){if(e.length>t)return e.slice(0,t);for(var n=e.length-1;n<t-1;n++)e.push(r("0,0,0",0));return e}(function(e){var t=[];for(var n in e)t.push(r(n,e[n]));return t.sort((function(e,t){return t.count-e.count})),t}(i),a+1);return{dominant:f[0].name,secondary:f[1].name,palette:f.map((function(e){return e.name})).slice(1)}}(e.data);postMessage({dominant:t})},test:(...e)=>e};onmessage=function(e){let[n,r,...o]=e.data;try{t[r]?postMessage([n,{response:t[r](...o)}]):postMessage([n,{error:"Task not registered"}])}catch(e){postMessage([n,{error:e}])}},(tco=void 0===tco?{}:tco).main=e})();