function isHidden(element, until) {
  if (!element || getComputedStyle(element).visibility === HIDDEN) return true

  while (element) {
    if (until != null && element === until) return false
    if (getComputedStyle(element).display === NONE) return true
    element = element.parentElement
  }

  return false
}
Check if DOM element is hidden
@param {HTMLElement|null|undefined} element
@param {HTMLElement|null|undefined} until
@return {boolean}