(function(){"use strict";const $=(s,t,e,o,a,n="fit")=>{const c=`http://${s}:${t}/api/image/${e}`;return o&&a?`${c}?scale=${n}&width=${o}&height=${a}`:c},h=(s,t,e)=>`${s}-${t}-[${e.join(",")}]`,f=(s,t,e,o,a,n="fit")=>{const[c,u]=a.split(":").map(Number),i=c/u;return o.map(r=>`${$(s,t,e,r,Math.round(r/i),n)} ${r}w`).join(", ")};self.onmessage=s=>{const t=s.data;if(!t||t.type!=="computeBatch")return;const{host:e,port:o,imageKeys:a,sizes:n,aspect:c,scale:u="fit"}=t,i=[];for(const p of a){const m=f(e,o,p,n,c,u);i.push({cacheKey:h(p,c,n),srcset:m})}const r={type:"batch",results:i};self.postMessage(r)}})();
