mirrored = false;
				canvasElement.style.transform = 'none';
			} else {
				mirrored = true;
				canvasElement.style.transform = 'scaleX(-1)';
			}
		});

		flipEl.addEventListener('click', () => {
			stopCamera();
			facingModeIndex = (facingModeIndex + 1) % facingMode.length;
			startCamera();
		});

		retakeEl.addEventListener('click', () => {
			startCamera();
			document.querySelectorAll('.step-download').forEach(hide);
			document.querySelectorAll('.step-capture').forEach(show);
			canvasContainer.s