Unable to define this context in document.eventListener

this is because in your event listener, this refers to the window instead of your class. you can fix this by adding .bind(this) to your function like so:

document.addEventListener("click", function (e) {
    // ...
}.bind(this));