[...document.getElementsByClassName("dialog__select")].forEach((item) => {
item.addEventListener('click', e => {
e.stopPropagation();
const trgt = e.target.classList.contains('dialog__tab') ? e.target.parentNode.closest('.dialog__row') : e.target ;
const listItem = Array.from(document.getElementsByClassName("dialog__row")).indexOf(trgt);
console.log(listItem)
})
})
str.replace(
/(?:(?<=<div\s+class="dialog__row_\d+">)|{([A-F\d]{6})})\s*([^\s<{][^<{]*)/g,
function () {
arguments.callee.color = arguments[1] || arguments.callee.color;
return `<span style="color:#${arguments.callee.color}">${arguments[2]}</span>\n`
}
)