{isEdit ? m.event_editor_edit_title() : m.event_editor_new_title()}
{#if form?.error}
{form.error}
{/if}
{ // Client-side guard against a blank title. enhance ignores onsubmit // preventDefault(), so cancel() is the only thing that actually stops the // POST; the server still re-validates and owns the authoritative fail(400). titleTouched = true; if (titleEmpty) { cancel(); return; } submitting = true; return async ({ update }) => { submitting = false; dirty = false; await update(); }; }} >
{#if event}
{/if}
{m.event_editor_section_when()}
{m.event_editor_title_label()}*
(titleTouched = true)} maxlength="255" placeholder={m.event_editor_title_placeholder()} aria-required="true" aria-invalid={titleError ? 'true' : undefined} aria-describedby={titleError ? 'event-title-error' : undefined} class="block min-h-[48px] w-full rounded border border-line px-3 py-3 text-base shadow-sm {titleError ? 'border-red-400 focus:outline-none focus-visible:ring-2 focus-visible:ring-red-500' : 'focus:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring'}" /> {#if titleError}
⚠
{titleError}
{/if}
{m.event_editor_type_label()}
{ type = t; markDirty(); }} />
{m.event_editor_section_description()}
{m.event_editor_description_label()}
{m.event_editor_section_persons()}
{m.event_editor_persons_label()}
{m.event_editor_section_documents()}
{m.event_editor_documents_label()}
{m.event_editor_save_hint()}
{m.event_editor_save()}
{#if isEdit}
{ const ok = await confirm({ title: m.event_editor_delete_confirm_title(), body: m.event_editor_delete_confirm_body(), destructive: true, confirmLabel: m.event_editor_delete() }); if (!ok) { cancel(); return; } return async ({ update }) => { // Clear dirtiness so beforeNavigate doesn't prompt "unsaved changes" // on the post-delete redirect. dirty = false; await update(); }; }} class="mt-4" >
{m.event_editor_delete()}
{/if}