function splitIntoEvenChunks(str, noOfLines = 2) {
let len = str.length;
let wordLen = Math.floor(len / noOfLines);
const lines = [];
let temp = '';
let counter = 0;
const parts = str
.split(' ')
.map((v) => {
return v.length > wordLen ? splitAtShy(v) : v;
})
.flat();
parts.forEach((v, i) => {
wordLen = Math.floor((len - lines.join(' ').length) / (noOfLines - counter));
if ((temp + v).length <= wordLen || i === 0) {
temp += ' ' + v;
} else {
lines.push(temp.trim());
counter++;
temp = v;
}
});
temp.trim() && lines.push(temp.trim());
return lines;
}