onSubmit(submission, saved) {
        this.loading = false;
        this.submitting = false;
        this.setPristine(true);
        // We want to return the submitted submission and setValue will mutate the submission so cloneDeep it here.
        this.setValue(fastCloneDeep(submission), {
            noValidate: true,
            noCheck: true,
        });
        this.setAlert('success', `<p>${this.t('complete')}</p>`);
        // Cancel triggered saveDraft to prevent overriding the submitted state
        if (this.draftEnabled && this.triggerSaveDraft?.cancel) {
            this.triggerSaveDraft.cancel();
        }
        this.emit('submit', submission, saved);
        if (saved) {
            this.emit('submitDone', submission);
        }
        return submission;
    }
Called when the submission has completed, or if the submission needs to be sent to an external library.
@param {object} submission - The submission object.
@param {boolean} saved - Whether or not this submission was saved to the server.
@returns {object} - The submission object.