  The three-manifold topological invariants $\hat Z$ capture the half-index of
the three-dimensional theory with ${\cal N}=2$ supersymmetry obtained by
compactifying the M5 brane theory on the closed three-manifold. In 2019,
surprising general relations between the $\hat Z$-invariants, quantum modular
forms, and vertex algebras, have been proposed. In the meanwhile, an extensive
array of examples have been studied, but several general important structural
questions remain. First, for many three-manifolds it was observed that the
different $\hat Z$-invariants for the same three-manifolds are quantum modular
forms that span a subspace of a Weil representation for the modular group
$SL_2(Z)$, corresponding to the structure of vector-valued quantum modular
forms. We elucidate the meaning of this vector-valued quantum modular form
structure by first proposing the analogue $\hat Z$-invariants with
supersymmetric defects, and subsequently showing that the full vector-valued
quantum modular form is precisely the object capturing all the $\hat
Z$-invariants, with and without defects, of a given three-manifold. Second, it
was expected that matching radial limits is a key feature of $\hat
Z$-invariants when changing the orientation of the plumbed three-manifold,
suggesting the relevance of mock modularity. We substantiate the conjecture by
providing explicit proposals for such $\hat Z$-invariants for an infinite
family of three-manifolds and verify their mock modularity and limits. Third,
we initiate the study of the vertex algebra structure of the mock type
invariants by showcasing a systematic way to construct cone vertex operator
algebras associated to these invariants, which can be viewed as the partner of
logarithmic vertex operator algebras in this context.
