{#if !loaded}{:else} {#if showForm}
{#if error}
{error}
{/if}
form.icon = v} /> nameManuallyEdited = true} required placeholder={t('cmdTemplateConfig.namePlaceholder')} class="flex-1 px-3 py-2 border border-[var(--color-border)] rounded-md text-sm bg-[var(--color-background)]" />
{#if !editing}
{t('templateConfig.providerType')}
{:else}
{t('templateConfig.providerType')} {allCapabilities[form.provider_type]?.display_name || form.provider_type}
{/if}
{t('templateConfig.language')}
{ activeLocale = (v as string) || primaryLocale; refreshAllPreviews(); }} />
{#if form.provider_type} {/if}
{#if commandSlots.length > 4}
{/if} {#each commandSlotGroups.filter(g => g.slots.length > 0) as group} {@const filteredSlots = slotFilter ? group.slots.filter(s => s.name.toLowerCase().includes(slotFilter.toLowerCase()) || s.description.toLowerCase().includes(slotFilter.toLowerCase())) : group.slots} {#if filteredSlots.length > 0}
{t(`cmdTemplateConfig.${group.group}`)}
{#each filteredSlots as slot} toggleSlot(slot.name)} >
{#if slotPreview[slot.name] && !slotErrors[slot.name]} {/if} {#if getVarsFor(slot.name)} {/if}
{#if showPreviewFor.has(slot.name) && slotPreview[slot.name] && !slotErrors[slot.name]}
{@html sanitizePreview(slotPreview[slot.name])}
{:else} { setSlotValue(slot.name, v); validateSlot(slot.name, v); }} rows={3} errorLine={slotErrorLines[slot.name] || null} variables={getVarsFor(slot.name) || undefined} /> {/if} {#if slotErrors[slot.name]} {#if slotErrorTypes[slot.name] === 'undefined'}

⚠ {t('common.undefinedVar')}: {slotErrors[slot.name]}

{:else}

вњ• {t('common.syntaxError')}: {slotErrors[slot.name]}{slotErrorLines[slot.name] ? ` (${t('common.line')} ${slotErrorLines[slot.name]})` : ''}

{/if} {/if}
{/each}
{/if} {/each}
{/if} {#if !showForm && allCmdTplConfigs.length > 0}
{#if !globalProviderFilter.id}
{/if}
{/if} {#if allCmdTplConfigs.length === 0 && !showForm} {:else if configs.length === 0 && !showForm} {:else}
{#each configs as config}

{config.name}

{config.provider_type} {#if config.user_id === 0} {t('common.system')} {/if}
{#if config.description}

{config.description}

{/if}
clone(config)} /> edit(config)} /> remove(config.id)} variant="danger" />
{/each}
{/if} {/if} confirmDelete?.onconfirm()} oncancel={() => confirmDelete = null} /> confirmReset = null} /> blockedBy = null} /> showVarsFor = null}> {#if showVarsFor && modalVars}

{modalVars.description}

{t('templateConfig.variables')}:

{#each Object.entries(modalVars.variables || {}) as [name, desc]}
{'{{ ' + name + ' }}'} {desc}
{/each}
{#each [ ['asset_fields', 'asset', 'Asset fields'], ['album_fields', 'album', 'Album fields'], ['command_fields', 'cmd', 'Command fields'], ['event_fields', 'event', 'Event fields'], ['repo_fields', 'repo', 'Repository fields'], ['issue_fields', 'issue', 'Issue fields'], ['pr_fields', 'pr', 'Pull request fields'], ['commit_fields', 'c', 'Commit fields'], ['board_fields', 'board', 'Board fields'], ['card_fields', 'card', 'Card fields'], ['list_fields', 'lst', 'List fields'], ['device_fields', 'd', 'Device fields'], ] as [fieldKey, prefix, title]} {#if modalVars[fieldKey]}

{title} (use {prefix}.field):

{#each Object.entries(modalVars[fieldKey]) as [name, desc]}
{'{{ ' + prefix + '.' + name + ' }}'} {desc}
{/each}
{/if} {/each} {/if}