1. If the function $f(x)=\ln \left(a \mathrm{e}^{x}-x-3\right)$ has a range of $\mathbf{R}$, then the range of the real number $a$ is $\qquad$ .
$-1 .\left(-\infty, \mathrm{e}^{2}\right]$.
Let $g(x)=a \mathrm{e}^{x}-x-3$.
Then the range of $f(x)$ is $\mathbf{R}$ if and only if $g(x)$ can take all values in $(0,+\infty)$.
When $a=0$, $g(x)=-x-3$. Clearly, $g(x)$ can take all values in $(0,+\infty)$.
Now consider the case where $a \neq 0$.
In this case, $g^{\prime}(x)=a \mathrm{e}^{x}-1$.
When $a>0$, let $g^{\prime}(x)=0$, solving gives $x=-\ln a$.
When $x \in(-\infty,-\ln a)$, $g^{\prime}(x)<0$, $g(x)$ is monotonically decreasing.
When $x \in(-\ln a, +\infty)$, $g^{\prime}(x)>0$, $g(x)$ is monotonically increasing.
Thus, $g(x)$ attains its minimum value at $x=-\ln a$, $(g(x))_{\text {min }}=g(-\ln a)=\ln a-2$.
To ensure that $g(x)$ can take all values in $(0,+\infty)$, we should have $(g(x))_{\text {min }} \leqslant 0$, solving gives $a \leqslant \mathrm{e}^{2}$.
In summary, the range of real number $a$ is $\left(-\infty, \mathrm{e}^{2}\right]$.