(8) Let $z$ be a complex number, and $|z|=1$, then the maximum and minimum values of $u=\left|z^{2}-z+1\right|$ are
$\qquad$
$$
=2019044 .
$$
8
$$
\begin{aligned}
u & =\left|z^{2}-z+1\right| \\
& =\left|z^{2}-z+z \bar{z}\right| \\
& =|z(z+\bar{z}-1)| \\
& =|z||(z+\bar{z}-1)| \\
& =1 \times|(x+y \mathrm{i}+x-y \mathrm{i}-1)| \\
& =|2 x-1| .
\end{aligned}
$$

Since $|z|=1$, we have $-1 \leqslant x \leqslant 1$, so the maximum value of $u$ is $3$, and the minimum value of $u$ is $0$.