Condición
{#if !rawMode && isEmpty}
siempre activa
{/if}
{#if store.errors.length > 0 && !rawMode}
{store.errors.length} error{store.errors.length > 1 ? 'es' : ''}
{/if}
{#if rawMode}
JsonLogic. Vacío = siempre activa.
{:else}
{#if store.root.kind === 'logic'}
{@const root = store.root}
{#if root.children.length > 1}
Combinar con
{#each (['and', 'or'] as const) as l}
{/each}
{/if}
{#each root.children as node (node.id)}
{#if node.kind === 'compare'}
{@const leftPath = getLeftPath(node)}
{@const ops = leftPath ? store.validOperatorsFor(leftPath) : []}
{@const opts = leftPath ? store.optsFor(leftPath) : []}
{@const isMulti = node.op === 'in' || node.op === '!in'}
{#if leftPath && ops.length > 0}
{/if}
{#if leftPath && opts.length === 0}
setRightLiteral(node.id, e.currentTarget.value)}
placeholder="valor..."
class="w-24 shrink-0 text-xs rounded border border-gray-700 bg-gray-800
text-gray-300 px-1.5 py-1" />
{/if}
{#if opts.length > 0}
{#each opts as opt}
{@const active = isOptActive(node, opt.optId)}
{/each}
{/if}
{/if}
{/each}
{/if}
{#if store.tautology.kind !== 'unknown'}
⚠ {store.tautology.kind === 'always-true' ? 'Siempre verdadera' : 'Siempre falsa'}
{/if}
{/if}