Inspect the close button element.
Within the Elements panel, next to Styles, there is an Event Listeners tab, which should list the events for which the code is listening and the functions of every listener.
However, like I mentioned before, the website apparently uses Archetype, which is an open source library. You do not have to copy the code from the website, because there is probably some documentation for the open source library that can be much clearer and easier to understand.
Also, note that copying stuff from websites without permissions is not legal (unless they have a permissive license).