def _compile_document_root(root: Component) -> str:
    """Compile the document root.

    Args:
        root: The document root to compile.

    Returns:
        The compiled document root.
    """
    document_root_imports = root._get_all_imports()
    _apply_common_imports(document_root_imports)
    return templates.DOCUMENT_ROOT.render(
        imports=utils.compile_imports(document_root_imports),
        document=root.render(),
    )
Compile the document root.

    Args:
        root: The document root to compile.

    Returns:
        The compiled document root.
    
reflex/compiler/compiler.py