{ if (!o) searchValue = ""; }} >
{ containerEl?.querySelector('input')?.focus(); }} > {#if value.length > 0} {#each (open ? value : visibleChips) as code (code)} { e.preventDefault(); e.stopPropagation(); }} onclick={(e) => { e.stopPropagation(); removeSubject(code); }} onkeydown={(e) => { if (e.key === "Enter" || e.key === " ") { e.stopPropagation(); removeSubject(code); } }} class="inline-flex items-center rounded bg-muted px-1.5 py-0.5 text-xs font-mono shrink-0 text-muted-foreground hover:outline hover:outline-1 hover:outline-ring cursor-pointer transition-[outline] duration-100 first:ml-2" > {code} {/each} {#if !open && overflowCount > 0} +{formatNumber(overflowCount)} {/if} {/if} (searchValue = e.currentTarget.value)} onfocus={() => { open = true; }} class="h-full min-w-0 flex-1 bg-transparent text-muted-foreground text-sm placeholder:text-muted-foreground outline-none border-none {value.length > 0 ? 'pl-1' : 'pl-3'}" placeholder={value.length > 0 ? "Filter..." : "All Subjects"} aria-label="Search subjects" autocomplete="off" autocorrect="off" spellcheck={false} />
{#snippet child({ wrapperProps, props, open: isOpen })} {#if isOpen}
{#each filteredSubjects as subject (subject.code)} {#snippet children({ selected })} {subject.code} {subject.description} {#if selected} {/if} {/snippet} {:else} No subjects found. {/each}
{/if} {/snippet}