_attachHiddenDiv(ast, hiddenDiv) {
        const firstHtmlImport = dom5.query(ast, matchers.eagerHtmlImport);
        const body = dom5.query(ast, matchers.body);
        if (body) {
            if (firstHtmlImport &&
                dom5.predicates.parentMatches(matchers.body)(firstHtmlImport)) {
                astUtils.insertAfter(firstHtmlImport, hiddenDiv);
            }
            else {
                astUtils.prepend(body, hiddenDiv);
            }
        }
        else {
            dom5.append(ast, hiddenDiv);
        }
    }
/**
     * Set the hidden div at the appropriate location within the document.  The
     * goal is to place the hidden div at the same place as the first html
     * import.  However, the div can't be placed in the `<head>` of the document
     * so if first import is found in the head, we prepend the div to the body.
     * If there is no body, we'll just attach the hidden div to the document at
     * the end.
     */
Set the hidden div at the appropriate location within the document.  The
goal is to place the hidden div at the same place as the first html
import.  However, the div can't be placed in the `` of the document
so if first import is found in the head, we prepend the div to the body.
If there is no body, we'll just attach the hidden div to the document at
the end.
Set the hidden div at the appropriate location within the document . The goal is to place the hidden div at the same place as the first html import . However the div can ' t be placed in the ` ` of the document so if first import is found in the head we prepend the div to the body . If there is no body we ' ll just attach the hidden div to the document at the end .
_attachHiddenDiv(ast, hiddenDiv) {
        const firstHtmlImport = dom5.query(ast, matchers.eagerHtmlImport);
        const body = dom5.query(ast, matchers.body);
        if (body) {
            if (firstHtmlImport &&
                dom5.predicates.parentMatches(matchers.body)(firstHtmlImport)) {
                astUtils.insertAfter(firstHtmlImport, hiddenDiv);
            }
            else {
                astUtils.prepend(body, hiddenDiv);
            }
        }
        else {
            dom5.append(ast, hiddenDiv);
        }
    }
_attachHiddenDiv ( ast , hiddenDiv ) { const firstHtmlImport = dom5 . query ( ast , matchers . eagerHtmlImport ) ; const body = dom5 . query ( ast , matchers . body ) ; if ( body ) { if ( firstHtmlImport && dom5 . predicates . parentMatches ( matchers . body ) ( firstHtmlImport ) ) { astUtils . insertAfter ( firstHtmlImport , hiddenDiv ) ; } else { astUtils . prepend ( body , hiddenDiv ) ; } } else { dom5 . append ( ast , hiddenDiv ) ; } }
Set the hidden div at the appropriate location within the document.
Set the hidden div at the appropriate location within the document .