(function(){let e,t;self.onmessage=n=>{let{width:r,height:i,strokes:a,maskStrokes:o}=n.data;if(n.data.type===`init`){e=n.data.canvas,t=e.getContext(`2d`);return}if(n.data.type===`draw`){t.fillStyle=`rgba(0, 0, 255, 0.3)`,t.fillRect(0,0,r,i),t.globalCompositeOperation=`destination-out`,[...a].forEach(e=>{e.forEach(e=>{let n=e.lineWidth;t.fillStyle=`rgba(0,0,0,1)`,t.beginPath(),t.arc(e.x,e.y,n/2,0,Math.PI*2),t.fill()})}),o?.forEach(e=>{e.forEach(e=>{t.fillStyle=`rgba(0,0,0,1)`,t.beginPath(),t.arc(e.x,e.y,4/2,0,Math.PI*2),t.fill()})});let e=t.getImageData(0,0,r,i);self.postMessage({type:`done`,imageData:e},[e.data.buffer])}}})();