function draw(t, e) { let n = t.getContext("2d"), o = []; var a = 0; e.forEach(t => { let l = new Image(); l.src = t; l.onload = () => { (a += 1) === e.length && function t() { let canvasWidth = t.width; let canvasHeight = t.height; let totalImageHeight = 0; for (let e = 0; e < o.length; e++) { totalImageHeight += o[e].height; } let startY = (canvasHeight - totalImageHeight) / 2; for (let e = 0; e < o.length; e++) { n.drawImage(o[e], 0, startY); startY += o[e].height; } }(); }; o.push(l);   }); }