const numberOfPassageClassChildrenInEmptyPassage = 4; // conncetedLocations, messageContainter, cheatMenu and actionBar

setup.passageIsEmpty = function(){
    let nonEmptyTextContents = $(".passage").contents().filter(function(){
        return this.nodeType == Node.TEXT_NODE && /\S/.test(this.nodeValue);
    });

    if(nonEmptyTextContents.length > 0)
        return false;

    let nonTextContents = $(".passage").contents().filter(function(){
        return this.nodeType != Node.TEXT_NODE;
    });

    if(nonTextContents.length > numberOfPassageClassChildrenInEmptyPassage)
        return false;

    return true;
}
