import type { PanzoomOptions } from './types' ; function getClass ( elem ) { return ( elem . getAttribute ( 'class' ) || '' ) . trim ( ) ; } function hasClass ( elem , className ) { return elem . nodeType === 1 && ` ${ getClass ( elem ) } ` . indexOf ( ` ${ className } ` ) > - 1 ; } export default function isExcluded ( elem , options ) { for ( let cur = elem ; cur != null ; cur = cur . parentNode as Element ) { if ( hasClass ( cur , options . excludeClass ) || options . exclude . indexOf ( cur ) > - 1 ) { return true ; } } return false ; }