{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "searchable-list",
  "type": "registry:component",
  "title": "Searchable list",
  "description": "Search a long list and tick items and their sub-items, such as makes and models.",
  "author": "Eugen Eşanu <https://eugenesanu.com>",
  "dependencies": [
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/filters/searchable-list.tsx",
      "type": "registry:component",
      "target": "@components/filters-ui/filters/searchable-list.tsx",
      "content": "\"use client\";\n\nimport { useEffect, useId, useRef, useState, type HTMLAttributes, type ReactNode } from \"react\";\nimport { cn } from \"../lib/cn\";\nimport { formatsFor, resultsLabel } from \"../lib/format\";\nimport { SCROLL } from \"../lib/scroll\";\nimport { SEARCH_ART } from \"../ui/art-search\";\nimport { CountPill } from \"../ui/count-pill\";\nimport { EmptyState } from \"../ui/empty-state\";\nimport { CheckIcon, SearchIcon } from \"../ui/icons\";\nimport { placeholderLabels, SkeletonText, useLoading } from \"../ui/skeleton\";\nimport { StatusFrame, type StateProps } from \"../ui/status-frame\";\nimport { TextField } from \"../ui/text-field\";\n\nexport type SearchableListChild = {\n  value: string;\n  label: string;\n  count: number;\n};\n\nexport type SearchableListOption = SearchableListChild & {\n  /** Shown indented under the option once it is ticked. Values need only be unique within their parent. */\n  children?: readonly SearchableListChild[];\n};\n\n/** One ticked option and the children that narrow it. No children means the whole option. */\nexport type SearchableListPick = {\n  value: string;\n  children: string[];\n};\n\nexport type SearchableListProps = Omit<HTMLAttributes<HTMLDivElement>, \"onChange\" | \"defaultValue\"> &\n  StateProps & {\n  /** In display order: the first `collapsedCount` make the short list, the rest show after \"All N\". */\n  options: readonly SearchableListOption[];\n  value: readonly SearchableListPick[];\n  onChange: (value: SearchableListPick[]) => void;\n  /** Accessible name of the list. */\n  label: string;\n  /** Plural noun for the options: \"Search makes\", \"All 21 makes\", \"No makes match\". */\n  noun?: string;\n  collapsedCount?: number;\n  formatCount?: (n: number) => string;\n  /** Screen-reader words for a count: \"6 results\". */\n  countLabel?: (n: number) => string;\n  /** Formats the counts and their spoken words by default, e.g. \"de-DE\". Default \"en-US\". */\n  locale?: string;\n  /**\n   * \"card\" (default): the look inside a FilterCard. \"panel\": a 48px search, 20px filled checkboxes, 17px names, counts as\n   * plain numbers and rows flush with the field, as in the Filter panel block. The list grows in place for its scrolling\n   * parent rather than scrolling in a box of its own.\n   */\n  variant?: \"card\" | \"panel\";\n};\n\nconst ROW_HEIGHT = 36;\nconst SMOOTH = \"ease-[cubic-bezier(0.22,1,0.36,1)]\";\n\n// Swapped letters count as one slip, so \"telsa\" is one edit from \"tesla\".\nfunction editDistance(a: string, b: string) {\n  const rows = Array.from({ length: a.length + 1 }, (_, i) => Array.from({ length: b.length + 1 }, (_, j) => (i === 0 ? j : j === 0 ? i : 0)));\n  for (let i = 1; i <= a.length; i++) {\n    for (let j = 1; j <= b.length; j++) {\n      rows[i][j] = Math.min(rows[i - 1][j] + 1, rows[i][j - 1] + 1, rows[i - 1][j - 1] + (a[i - 1] === b[j - 1] ? 0 : 1));\n      if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) rows[i][j] = Math.min(rows[i][j], rows[i - 2][j - 2] + 1);\n    }\n  }\n  return rows[a.length][b.length];\n}\n\n/** The closest name with results, for a word of 4+ letters: one slip allowed, two past 5 letters. On a tie the longer name wins. */\nfunction nearestName(typed: string, options: readonly SearchableListOption[]) {\n  if (typed.length < 4) return null;\n  const allowed = typed.length > 5 ? 2 : 1;\n  // Names further apart in length than the slips allowed cannot match, so a long paste costs nothing.\n  const names = options\n    .flatMap((o) => [o, ...(o.children ?? [])])\n    .filter((o) => o.count > 0 && Math.abs(o.label.length - typed.length) <= allowed);\n  const [best] = names\n    .map((o) => ({ name: o.label, edits: editDistance(typed, o.label.toLowerCase()) }))\n    .filter((o) => o.edits <= allowed)\n    .sort((a, b) => a.edits - b.edits || b.name.length - a.name.length);\n  return best?.name ?? null;\n}\n\n// Names in the panel look are already semibold, so there the letters around the match dim instead.\nfunction Marked({ text, query, panel = false }: { text: string; query: string; panel?: boolean }) {\n  const at = query ? text.toLowerCase().indexOf(query) : -1;\n  if (at < 0) return <>{text}</>;\n  if (panel) {\n    const dim = \"text-[var(--fu-dim,#929292)]\";\n    return (\n      <>\n        <span className={dim}>{text.slice(0, at)}</span>\n        {text.slice(at, at + query.length)}\n        <span className={dim}>{text.slice(at + query.length)}</span>\n      </>\n    );\n  }\n  return (\n    <>\n      {text.slice(0, at)}\n      <b className=\"font-semibold\">{text.slice(at, at + query.length)}</b>\n      {text.slice(at + query.length)}\n    </>\n  );\n}\n\n/** Opens and closes with the card's own motion: height over 480ms, content in from a 6px blur, 6px lower. */\nfunction Reveal({ open, children }: { open: boolean; children: ReactNode }) {\n  return (\n    <div\n      inert={!open}\n      data-state={open ? \"open\" : \"closed\"}\n      className={cn(\n        \"group/reveal grid grid-rows-[0fr] transition-[grid-template-rows] duration-[480ms] motion-reduce:transition-none\",\n        SMOOTH,\n        \"data-[state=open]:grid-rows-[1fr]\",\n      )}\n    >\n      <div className=\"min-h-0 overflow-hidden\">\n        <div\n          className={cn(\n            \"translate-y-1.5 opacity-0 blur-[6px] transition-[opacity,filter,translate] duration-[480ms] motion-reduce:transition-none\",\n            SMOOTH,\n            \"group-data-[state=open]/reveal:translate-y-0 group-data-[state=open]/reveal:opacity-100 group-data-[state=open]/reveal:blur-none\",\n            \"group-data-[state=open]/reveal:delay-[120ms] group-data-[state=open]/reveal:duration-[460ms] group-data-[state=open]/reveal:ease-[cubic-bezier(0.16,1,0.3,1)]\",\n          )}\n        >\n          {children}\n        </div>\n      </div>\n    </div>\n  );\n}\n\ntype RowProps = {\n  label: string;\n  query: string;\n  count: number;\n  checked: boolean;\n  disabled: boolean;\n  nested?: boolean;\n  panel: boolean;\n  formatCount: (n: number) => string;\n  countLabel: (n: number) => string;\n  onToggle: (input: HTMLInputElement) => void;\n  onBlur: () => void;\n};\n\n// The whole row is the checkbox's label. A long name wraps onto more lines; the box and the count stay in the row. The native box is hidden and drawn again: 18px, 5px radius, the tile's selected fill with an accent check that draws in.\n// The panel look draws it 20px with 6px corners, filled with the accent and an --fu-on-accent check once ticked.\nfunction Row({ label, query, count, checked, disabled, nested, panel, formatCount, countLabel, onToggle, onBlur }: RowProps) {\n  const { loading } = useLoading();\n  return (\n    <label\n      data-state={checked ? \"on\" : \"off\"}\n      className={cn(\n        \"group/row relative flex min-h-9 min-w-0 cursor-pointer items-center gap-2.5 rounded-[12px] py-2 pe-3 text-[14px] leading-5 text-[var(--fu-text,#F8F5F1)]\",\n        nested ? \"ps-[40px]\" : \"ps-3\",\n        // 17px names on a 24px line, 6px above and below: 36px, as the card look's 20px line with 8px.\n        panel && \"rounded-[10px] py-1.5 pe-2 text-[17px] leading-6 font-semibold pointer-coarse:min-h-11\",\n        panel && (nested ? \"ps-[38px]\" : \"ps-2\"),\n        \"transition-[background-color,opacity] duration-200 motion-reduce:transition-none\",\n        \"[@media(hover:hover)]:has-[input:enabled]:hover:bg-[var(--fu-wash,rgb(255_255_255/0.08))]\",\n        // Drawn inside the row, so neither the scroll area nor the card can clip it.\n        \"has-[input:focus-visible]:outline-2 has-[input:focus-visible]:-outline-offset-2 has-[input:focus-visible]:outline-solid has-[input:focus-visible]:outline-[var(--fu-accent-soft,#8FAAFF)]\",\n        \"has-[input:disabled]:cursor-not-allowed\",\n        count === 0 && !checked && !loading && \"opacity-40\",\n      )}\n    >\n      <input\n        type=\"checkbox\"\n        checked={checked}\n        disabled={disabled}\n        aria-label={`${label}, ${countLabel(count)}`}\n        onChange={(event) => onToggle(event.currentTarget)}\n        onBlur={onBlur}\n        className={cn(\"peer absolute size-[18px] cursor-[inherit] opacity-0\", panel && \"size-5\")}\n      />\n      <span\n        aria-hidden=\"true\"\n        className={cn(\n          \"grid size-[18px] shrink-0 place-items-center rounded-[5px] border border-[var(--fu-control-border,#737373)] text-[var(--fu-accent-soft,#8FAAFF)]\",\n          \"transition-[background-color,border-color] duration-200 motion-reduce:transition-none\",\n          SMOOTH,\n          \"[@media(hover:hover)]:group-hover/row:peer-enabled:border-[var(--fu-control-hover,#A3A3A3)]\",\n          panel\n            ? \"size-5 rounded-[6px] border-[1.5px] bg-[var(--fu-field-wash,rgb(255_255_255/0.03))] text-[var(--fu-on-accent,#FFFFFF)] peer-checked:border-[var(--fu-accent,#3B57E6)] peer-checked:bg-[var(--fu-accent,#3B57E6)] [@media(hover:hover)]:group-hover/row:peer-checked:border-[var(--fu-accent,#3B57E6)]\"\n            : \"peer-checked:border-[var(--fu-accent-soft,#8FAAFF)] peer-checked:bg-[var(--fu-selected,#1F2747)] [@media(hover:hover)]:group-hover/row:peer-checked:border-[var(--fu-accent-soft,#8FAAFF)]\",\n        )}\n      >\n        <CheckIcon\n          size={14}\n          strokeWidth={3}\n          className={cn(\n            // The path is about 23 units long; a negative offset draws it from the short leg up.\n            \"[&_path]:[stroke-dasharray:23] [&_path]:[stroke-dashoffset:-23] [&_path]:transition-[stroke-dashoffset] [&_path]:duration-200 motion-reduce:[&_path]:transition-none\",\n            \"[&_path]:ease-[cubic-bezier(0.22,1,0.36,1)] group-data-[state=on]/row:[&_path]:[stroke-dashoffset:0]\",\n          )}\n        />\n      </span>\n      <span aria-hidden=\"true\" className=\"min-w-0 flex-1 [overflow-wrap:anywhere]\">\n        <SkeletonText>\n          <Marked text={label} query={query} panel={panel} />\n        </SkeletonText>\n      </span>\n      {panel ? (\n        <span aria-hidden=\"true\" className=\"shrink-0 font-normal tabular-nums text-[var(--fu-mute,#BDBDBD)]\">\n          <SkeletonText>{formatCount(count)}</SkeletonText>\n        </span>\n      ) : (\n        <CountPill aria-hidden=\"true\" variant=\"square\" on={checked} count={count} format={formatCount} />\n      )}\n    </label>\n  );\n}\n\n/**\n * A search field over a checklist whose options open their own children when ticked, e.g. makes and their models.\n * The short list shows the first `collapsedCount` options and grows with what is ticked; \"All N\" adds the rest inside a\n * scroll area capped at 320px. Typing filters options and children at once, holding the short list's height so the card\n * does not jump per key; a typo with no match offers the nearest name.\n */\nexport function SearchableList({\n  options,\n  value,\n  onChange,\n  label,\n  noun = \"items\",\n  collapsedCount = 8,\n  formatCount: formatCountProp,\n  countLabel: countLabelProp,\n  locale,\n  variant = \"card\",\n  status = \"ready\",\n  onRetry,\n  errorText = `Couldn't load the ${noun}.`,\n  emptyText = `No ${noun} to show`,\n  disabled = false,\n  className,\n  ...props\n}: SearchableListProps) {\n  const formatCount = formatCountProp ?? formatsFor(locale).number;\n  const countLabel = countLabelProp ?? ((n: number) => resultsLabel(n, locale));\n  const panel = variant === \"panel\";\n  const listId = useId();\n  const [query, setQuery] = useState(\"\");\n  const [all, setAll] = useState(false);\n  const field = useRef<HTMLDivElement>(null);\n  const scroller = useRef<HTMLDivElement>(null);\n  const content = useRef<HTMLUListElement>(null);\n  const [fade, setFade] = useState({ top: false, bottom: false });\n\n  // A row turned off at 0 would become disabled under the pointer or keyboard and drop focus; it stays enabled until it loses focus.\n  const [kept, setKept] = useState<string | null>(null);\n\n  // Ticked options past the short list stay in it while it is short, and do not vanish when unticked there.\n  const tickedLater = value.map((p) => p.value).filter((v) => options.findIndex((o) => o.value === v) >= collapsedCount);\n  const [pinned, setPinned] = useState<string[]>(tickedLater);\n  if (tickedLater.some((v) => !pinned.includes(v))) setPinned([...pinned, ...tickedLater.filter((v) => !pinned.includes(v))]);\n  if (value.length === 0 && pinned.length > 0 && !all) setPinned([]);\n\n  const pickOf = (v: string) => value.find((p) => p.value === v);\n\n  const toggleParent = (v: string, input: HTMLInputElement) => {\n    const on = Boolean(pickOf(v));\n    setKept(on && document.activeElement === input ? v : null);\n    onChange(on ? value.filter((p) => p.value !== v) : [...value, { value: v, children: [] }]);\n  };\n\n  // Ticking a child ticks its parent too; a child narrows the parent to the children ticked.\n  const toggleChild = (parent: string, child: string, input: HTMLInputElement) => {\n    const pick = pickOf(parent);\n    const on = Boolean(pick?.children.includes(child));\n    setKept(on && document.activeElement === input ? `${parent}\\n${child}` : null);\n    if (!pick) return onChange([...value, { value: parent, children: [child] }]);\n    const children = on ? pick.children.filter((c) => c !== child) : [...pick.children, child];\n    onChange(value.map((p) => (p.value === parent ? { ...p, children } : p)));\n  };\n\n  useEffect(() => {\n    const node = scroller.current;\n    const inner = content.current;\n    if (!node || !inner) return;\n    const measure = () => {\n      const top = node.scrollTop > 1;\n      const bottom = node.scrollTop + node.clientHeight < node.scrollHeight - 1;\n      setFade((f) => (f.top === top && f.bottom === bottom ? f : { top, bottom }));\n    };\n    measure();\n    node.addEventListener(\"scroll\", measure, { passive: true });\n    const observer = new ResizeObserver(measure);\n    observer.observe(node);\n    observer.observe(inner);\n    return () => {\n      node.removeEventListener(\"scroll\", measure);\n      observer.disconnect();\n    };\n    // The frame takes the list away in an error or with no options; its listeners go on the new box when it is back.\n  }, [status, options.length === 0]);\n\n  // Its own status, or the loading frame of an item around it, such as a block's card.\n  const loading = useLoading().loading || status === \"loading\";\n  // While the options are on their way, a short list of stand-ins keeps the place they will take.\n  const listed: readonly SearchableListOption[] =\n    loading && options.length === 0 ? placeholderLabels(collapsedCount).map((name) => ({ value: name, label: name, count: 0 })) : options;\n  const typed = loading ? \"\" : query.trim().toLowerCase();\n\n  const parentRow = (option: SearchableListOption, q: string) => {\n    const checked = Boolean(pickOf(option.value));\n    return (\n      <Row\n        label={option.label}\n        query={q}\n        count={option.count}\n        checked={checked}\n        disabled={option.count === 0 && !checked && kept !== option.value}\n        panel={panel}\n        formatCount={formatCount}\n        countLabel={countLabel}\n        onToggle={(input) => toggleParent(option.value, input)}\n        onBlur={() => kept === option.value && setKept(null)}\n      />\n    );\n  };\n\n  const childRows = (option: SearchableListOption, children: readonly SearchableListChild[], q: string) => {\n    const pick = pickOf(option.value);\n    return (\n      <ul aria-label={option.label} className=\"m-0 list-none p-0\">\n        {children.map((child) => {\n          const key = `${option.value}\\n${child.value}`;\n          const checked = Boolean(pick?.children.includes(child.value));\n          return (\n            <li key={child.value} className=\"m-0 p-0\">\n              <Row\n                nested\n                label={child.label}\n                query={q}\n                count={child.count}\n                checked={checked}\n                disabled={child.count === 0 && !checked && kept !== key}\n                panel={panel}\n                formatCount={formatCount}\n                countLabel={countLabel}\n                onToggle={(input) => toggleChild(option.value, child.value, input)}\n                onBlur={() => kept === key && setKept(null)}\n              />\n            </li>\n          );\n        })}\n      </ul>\n    );\n  };\n\n  let rows: ReactNode;\n  let found = 0;\n  if (typed) {\n    const matches = options.flatMap((option) => {\n      const children = option.children ?? [];\n      const self = option.label.toLowerCase().includes(typed);\n      const kids = children.filter((c) => c.label.toLowerCase().includes(typed));\n      return self || kids.length ? [{ option, self, kids }] : [];\n    });\n    found = matches.length;\n    rows = matches.map(({ option, self, kids }) => {\n      const checked = Boolean(pickOf(option.value));\n      const showAll = !kids.length || (checked && self);\n      return (\n        <li key={option.value} className=\"m-0 p-0\">\n          {parentRow(option, typed)}\n          {(option.children?.length ?? 0) > 0 && (\n            <Reveal open={checked || kids.length > 0}>{childRows(option, showAll ? option.children! : kids, typed)}</Reveal>\n          )}\n        </li>\n      );\n    });\n  } else {\n    rows = listed.map((option, i) => {\n      const item = (\n        <>\n          {parentRow(option, \"\")}\n          {(option.children?.length ?? 0) > 0 && <Reveal open={Boolean(pickOf(option.value))}>{childRows(option, option.children!, \"\")}</Reveal>}\n        </>\n      );\n      return (\n        <li key={option.value} className=\"m-0 p-0\">\n          {i < collapsedCount ? item : <Reveal open={all || pinned.includes(option.value)}>{item}</Reveal>}\n        </li>\n      );\n    });\n  }\n\n  const none = Boolean(typed) && found === 0;\n  const near = none ? nearestName(typed, options) : null;\n  const more = listed.length > collapsedCount;\n\n  return (\n    <div className={cn(\"min-w-0\", className)} {...props}>\n      <StatusFrame\n        status={status}\n        onRetry={onRetry}\n        errorText={errorText}\n        empty={options.length === 0}\n        emptyText={emptyText}\n        disabled={disabled}\n        className={cn(panel && \"rounded-[14px]\")}\n      >\n        <div ref={field}>\n          <TextField\n            type=\"search\"\n            value={query}\n            onChange={setQuery}\n            label={`Search ${noun}`}\n            placeholder={`Search ${noun}`}\n            prefix={<SearchIcon size={panel ? 20 : 16} className=\"block\" />}\n            clearLabel=\"Clear search\"\n            autoComplete=\"off\"\n            spellCheck={false}\n            className={panel ? \"h-12 gap-3 bg-[var(--fu-field-wash,rgb(255_255_255/0.03))] px-3.5 text-[17px]\" : undefined}\n            inputClassName=\"[&::-webkit-search-cancel-button]:appearance-none\"\n            onKeyDown={(event) => {\n              if (event.key === \"Escape\" && query) {\n                event.stopPropagation();\n                event.preventDefault();\n                setQuery(\"\");\n              }\n            }}\n          />\n        </div>\n\n        {/* In the panel look the list reaches 8px past the field on each side, so boxes and counts line up with its edges.\n            The panel scrolls the whole list itself, so there the list neither scrolls in its own box nor holds its height while typing.\n            Opened in full, the scroll box reaches 10px into the card's padding and the rows keep the width of this box\n            (100cqi), so the scrollbar sits beside the rows and no count moves when it appears. */}\n        <div className={cn(\"relative mt-2\", panel ? \"-mx-2\" : \"@container\")}>\n          <div\n            ref={scroller}\n            id={listId}\n            className={cn(\n              all && !panel && [\"-me-2.5 max-h-80 scroll-py-7 overflow-x-hidden overflow-y-auto overscroll-contain\", SCROLL],\n            )}\n            style={typed && !panel && !none ? { minHeight: collapsedCount * ROW_HEIGHT } : undefined}\n          >\n            <ul ref={content} aria-label={label} className={cn(\"m-0 list-none p-0\", all && !panel && \"w-[100cqi]\")}>\n              {rows}\n            </ul>\n          </div>\n          <div\n            aria-hidden=\"true\"\n            className={cn(\n              \"pointer-events-none absolute inset-x-0 top-0 h-6 bg-linear-to-b from-[var(--fu-card,#1F1F1F)] to-transparent opacity-0 transition-opacity duration-200 motion-reduce:transition-none\",\n              fade.top && \"opacity-100\",\n            )}\n          />\n          <div\n            aria-hidden=\"true\"\n            className={cn(\n              \"pointer-events-none absolute inset-x-0 bottom-0 h-6 bg-linear-to-t from-[var(--fu-card,#1F1F1F)] to-transparent opacity-0 transition-opacity duration-200 motion-reduce:transition-none\",\n              fade.bottom && \"opacity-100\",\n            )}\n          />\n        </div>\n\n        {/* Nothing matches: the picture, the line and one way on sit in the middle of the room the short list takes,\n            so the card keeps its height. The region stays on the page, so the line is read out when it arrives. */}\n        <div\n          role=\"status\"\n          className={cn(none && \"grid place-items-center px-3\", none && panel && \"px-0 py-6\")}\n          style={none && !panel ? { minHeight: collapsedCount * ROW_HEIGHT } : undefined}\n        >\n          {none && (\n            <EmptyState\n              art={SEARCH_ART}\n              title={\n                <span className=\"flex min-w-0 justify-center\">\n                  <span className=\"shrink-0\">No {noun} match&nbsp;</span>\n                  <span className=\"min-w-0 truncate\">“{query.trim()}</span>\n                  <span className=\"shrink-0\">”</span>\n                </span>\n              }\n              action={\n                <button\n                  type=\"button\"\n                  onClick={() => {\n                    setQuery(near ?? \"\");\n                    field.current?.querySelector(\"input\")?.focus();\n                  }}\n                  className={cn(\n                    \"relative cursor-pointer rounded-[6px] text-[14px] leading-5 font-medium text-[var(--fu-accent-soft,#8FAAFF)] transition-[color] duration-200 before:absolute before:inset-x-0 before:-inset-y-2 before:content-[''] hover:text-[var(--fu-accent-pale,#D1DDFF)]\",\n                    \"outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-solid focus-visible:outline-[var(--fu-accent-soft,#8FAAFF)]\",\n                  )}\n                >\n                  {near ? `Did you mean ${near}?` : \"Clear search\"}\n                </button>\n              }\n            />\n          )}\n        </div>\n\n        {!typed && more && (\n          <button\n            type=\"button\"\n            aria-expanded={all}\n            aria-controls={listId}\n            onClick={() => {\n              if (all) setPinned(tickedLater);\n              setAll(!all);\n            }}\n            className={cn(\n              \"group/more relative mt-1.5 ms-3 cursor-pointer rounded-[6px] text-[14px] leading-5 font-medium text-[var(--fu-accent-soft,#8FAAFF)] transition-[color] duration-200 hover:text-[var(--fu-accent-pale,#D1DDFF)] before:absolute before:-inset-x-1 before:-inset-y-2 before:content-['']\",\n              \"outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-solid focus-visible:outline-[var(--fu-accent-soft,#8FAAFF)]\",\n              panel && \"mt-2 ms-0 text-[15px] pointer-coarse:before:-inset-y-3\",\n            )}\n          >\n            {/* A 1px line draws in under the words from the start edge while it is hovered or focused. */}\n            <span\n              className={cn(\n                \"bg-[linear-gradient(currentColor,currentColor)] bg-[length:0%_1px] bg-[position:0_100%] rtl:bg-[position:100%_100%] bg-no-repeat pb-px\",\n                \"transition-[background-size] duration-300 ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:transition-none\",\n                \"[@media(hover:hover)]:group-hover/more:bg-[length:100%_1px] group-focus-visible/more:bg-[length:100%_1px]\",\n              )}\n            >\n              <SkeletonText>{all ? \"Show fewer\" : `All ${formatCount(listed.length)} ${noun}`}</SkeletonText>\n            </span>\n          </button>\n        )}\n      </StatusFrame>\n    </div>\n  );\n}\n"
    },
    {
      "path": "registry/lib/cn.ts",
      "type": "registry:lib",
      "target": "@components/filters-ui/lib/cn.ts",
      "content": "import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n"
    },
    {
      "path": "registry/lib/format.ts",
      "type": "registry:lib",
      "target": "@components/filters-ui/lib/format.ts",
      "content": "// Numbers, prices, distances, percents and dates for one locale, built on Intl with no dependency. Pass any BCP 47\n// tag (\"de-DE\", \"ar-EG\"); a tag Intl cannot read falls back to en-US instead of throwing. The default is en-US, never\n// the browser's own locale, so the server and the browser always print the same text. UI words stay English.\n\nexport const DEFAULT_LOCALE = \"en-US\";\n\nexport type FormatOptions = {\n  /** ISO 4217 code for price and priceShort. Default \"USD\". */\n  currency?: string;\n  /** The unit of distance. Default \"kilometer\". */\n  unit?: \"kilometer\" | \"mile\";\n};\n\n/** Every formatter takes the value alone, so any of them can be passed straight to a format prop. */\nexport type Formats = {\n  /** The locale these formatters use, after any fallback. */\n  locale: string;\n  /** \"1,234\" in en-US, \"1.234\" in de-DE, up to three decimals. */\n  number: (value: number) => string;\n  /** A number with no group marks, such as a year: \"2026\", or \"٢٠٢٦\" in ar-EG. */\n  plain: (value: number) => string;\n  /** \"45k\", \"1.2M\". */\n  compact: (value: number) => string;\n  /** \"$45,000\" in en-US, \"45.000 $\" in de-DE: whole units of the currency. */\n  price: (value: number) => string;\n  /** \"$45k\" and \"$97.5k\" from a thousand up, \"$950\" below. */\n  priceShort: (value: number) => string;\n  /** \"50,000 km\" or \"31,069 mi\". */\n  distance: (value: number) => string;\n  /** A percentage given in percent, up to two decimals: 6.5 gives \"6.5%\" in en-US and \"6,5 %\" in de-DE. */\n  percent: (value: number) => string;\n  /** A day given as \"YYYY-MM-DD\", in words. Read in UTC, so it never shifts by a time zone. */\n  day: (iso: string, options: Intl.DateTimeFormatOptions) => string;\n  /** The name of a month, 0 for January. */\n  month: (index: number, style?: \"long\" | \"short\") => string;\n  /** The name of a weekday, 0 for Sunday. */\n  weekday: (index: number, style?: \"long\" | \"short\") => string;\n  /** The day weeks start on: 0 for Sunday, 1 for Monday, 6 for Saturday. */\n  firstDay: 0 | 1 | 5 | 6;\n  /** The locale's digits, 0 to 9: \"0123456789\", or \"٠١٢٣٤٥٦٧٨٩\" in ar-EG. */\n  digits: string;\n  /**\n   * Reads a number typed the locale's way, with an optional k or m: \"45,000\", \"$45k\" and \"1.2m\" in en-US, \"45.000\"\n   * and \"1,2m\" in de-DE. A unit such as \"km\" is not a suffix. Returns null when the text holds no number.\n   */\n  readNumber: (text: string) => number | null;\n};\n\n/**\n * A locale Intl has data for, or en-US. A well-formed tag with no data (\"zz\") would otherwise print in the\n * runtime's own locale, which differs between server and browser.\n */\nexport function safeLocale(locale?: string): string {\n  if (!locale) return DEFAULT_LOCALE;\n  try {\n    const [tag] = Intl.getCanonicalLocales(locale);\n    if (!tag) return DEFAULT_LOCALE;\n    if (!Intl.NumberFormat.supportedLocalesOf(tag).length || !Intl.DateTimeFormat.supportedLocalesOf(tag).length) return DEFAULT_LOCALE;\n    return tag;\n  } catch {\n    return DEFAULT_LOCALE;\n  }\n}\n\n/** A currency code Intl can read, or USD. */\nfunction safeCurrency(currency?: string): string {\n  if (!currency) return \"USD\";\n  try {\n    new Intl.NumberFormat(DEFAULT_LOCALE, { style: \"currency\", currency });\n    return currency.toUpperCase();\n  } catch {\n    return \"USD\";\n  }\n}\n\n// Where weeks start, by region, as CLDR 48 has it; every other region starts on Monday. A table rather than\n// Intl.Locale weekInfo, which not every browser has, so the server and every browser agree.\nconst SUNDAY = new Set(\n  \"AG AS BD BR BS BT BW BZ CA CO DM DO ET GT GU HK HN ID IL IN IS JM JP KE KH KR LA MH MM MO MT MX MZ NI NP PA PE PH PK PR PT PY SA SG SV TH TT TW UM US VE VI WS YE ZA ZW\".split(\" \"),\n);\nconst SATURDAY = new Set(\"AF BH DJ DZ EG IQ IR JO KW LY OM QA SD SY\".split(\" \"));\n\nfunction firstDayOf(locale: string): 0 | 1 | 5 | 6 {\n  let region: string | undefined;\n  try {\n    region = new Intl.Locale(locale).maximize().region;\n  } catch {}\n  if (!region) return 0;\n  if (region === \"MV\") return 5;\n  if (SATURDAY.has(region)) return 6;\n  return SUNDAY.has(region) ? 0 : 1;\n}\n\nconst cache = new Map<string, Formats>();\n\n/** Formatters for one locale. Cheap to call on every render: each locale and option set is built once. */\nexport function formatsFor(locale?: string, options: FormatOptions = {}): Formats {\n  const tag = safeLocale(locale);\n  const currency = safeCurrency(options.currency);\n  const unit = options.unit === \"mile\" ? \"mile\" : \"kilometer\";\n  const key = `${tag}|${currency}|${unit}`;\n  const known = cache.get(key);\n  if (known) return known;\n\n  const nf = (o: Intl.NumberFormatOptions) => new Intl.NumberFormat(tag, o);\n  const dates = new Map<string, Intl.DateTimeFormat>();\n  const df = (o: Intl.DateTimeFormatOptions) => {\n    const id = JSON.stringify(o);\n    let format = dates.get(id);\n    if (!format) {\n      format = new Intl.DateTimeFormat(tag, { ...o, timeZone: \"UTC\" });\n      dates.set(id, format);\n    }\n    return format;\n  };\n  // English writes thousands with a small k, as the filters always have.\n  const english = tag === \"en\" || tag.startsWith(\"en-\");\n  const smallK = (text: string) => (english ? text.replace(/K\\b/, \"k\") : text);\n\n  const number = nf({});\n  const plain = nf({ useGrouping: false, maximumFractionDigits: 20 });\n  const compact = nf({ notation: \"compact\", maximumFractionDigits: 1 });\n  const price = nf({ style: \"currency\", currency, minimumFractionDigits: 0, maximumFractionDigits: 0 });\n  // One decimal is exact for a 1,000 unit (\"$97.5k\"); a 10,000 unit such as 万 takes two (\"$9.75万\").\n  const unitDigits = nf({ notation: \"compact\", useGrouping: false }).formatToParts(10000).filter((p) => p.type === \"integer\").map((p) => p.value).join(\"\").length;\n  const priceShort = nf({ style: \"currency\", currency, notation: \"compact\", minimumFractionDigits: 0, maximumFractionDigits: Math.max(1, 3 - unitDigits) });\n  const distance = nf({ style: \"unit\", unit, maximumFractionDigits: 0 });\n  const percent = nf({ style: \"percent\", maximumFractionDigits: 2 });\n\n  const digits = plain.format(1234567890).replace(/^(.*)(.)$/, \"$2$1\");\n  const parts = number.formatToParts(12345.6);\n  const group = parts.find((p) => p.type === \"group\")?.value ?? \",\";\n  const decimal = parts.find((p) => p.type === \"decimal\")?.value ?? \".\";\n\n  const formats: Formats = {\n    locale: tag,\n    number: (value) => number.format(value),\n    plain: (value) => plain.format(value),\n    compact: (value) => smallK(compact.format(value)),\n    price: (value) => price.format(value),\n    priceShort: (value) => (Math.abs(value) >= 1000 ? smallK(priceShort.format(value)) : price.format(value)),\n    distance: (value) => distance.format(value),\n    percent: (value) => percent.format(value / 100),\n    day: (iso, o) => df(o).format(Date.UTC(Number(iso.slice(0, 4)), Number(iso.slice(5, 7)) - 1, Number(iso.slice(8, 10)))),\n    month: (index, style = \"long\") => df({ month: style }).format(Date.UTC(2021, index, 1)),\n    // 3 January 2021 was a Sunday.\n    weekday: (index, style = \"long\") => df({ weekday: style }).format(Date.UTC(2021, 0, 3 + index)),\n    firstDay: firstDayOf(tag),\n    digits,\n    readNumber: (text) => {\n      let t = text.replace(/[\\s  ‎‏؜]/g, \"\");\n      for (let i = 0; i < 10; i++) t = t.split(digits[i]).join(String(i));\n      if (!/\\s/.test(group)) t = t.split(group).join(\"\");\n      // Marks typed in place of the locale's own: a Latin or Arabic comma where both marks are Arabic, a curly apostrophe for a straight one.\n      if (!/[.,]/.test(group + decimal)) t = t.replace(/[,\\u060c]/g, \"\");\n      if (group === \"'\") t = t.split(\"\\u2019\").join(\"\");\n      if (decimal !== \".\") t = t.split(decimal).join(\".\");\n      const match = t.match(/(\\d*\\.?\\d+)([km](?![a-z]))?/i);\n      if (!match) return null;\n      const scale = match[2] ? (match[2].toLowerCase() === \"k\" ? 1e3 : 1e6) : 1;\n      return Number(match[1]) * scale;\n    },\n  };\n  cache.set(key, formats);\n  return formats;\n}\n\n/** \"1 result\", \"1,204 results\": the default words for a count, with the number in the locale. */\nexport const resultsLabel = (n: number, locale?: string) => `${formatsFor(locale).number(n)} ${n === 1 ? \"result\" : \"results\"}`;\n"
    },
    {
      "path": "registry/lib/scroll.ts",
      "type": "registry:lib",
      "target": "@components/filters-ui/lib/scroll.ts",
      "content": "/**\n * A slim scrollbar for every box that scrolls: a 6px rounded thumb in the line colour on a clear track, stronger under\n * the pointer, kept 2px off the side and 12px off each end so it never runs into a rounded corner.\n * Chromium and Safari draw it from the ::-webkit-scrollbar parts. Firefox has none of those, so it alone gets the\n * standard thin bar in the same colours: Chromium ignores the parts once scrollbar-width or scrollbar-color is set,\n * so never add either beside this class.\n */\nexport const SCROLL =\n  \"supports-[not(selector(::-webkit-scrollbar))]:[scrollbar-width:thin] supports-[not(selector(::-webkit-scrollbar))]:[scrollbar-color:var(--fu-line,#404040)_transparent] \" +\n  \"[&::-webkit-scrollbar]:size-2.5 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-corner]:bg-transparent \" +\n  \"[&::-webkit-scrollbar-track:vertical]:my-3 [&::-webkit-scrollbar-track:horizontal]:mx-3 \" +\n  \"[&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:border-2 [&::-webkit-scrollbar-thumb]:border-solid [&::-webkit-scrollbar-thumb]:border-transparent [&::-webkit-scrollbar-thumb]:bg-clip-padding \" +\n  \"[&::-webkit-scrollbar-thumb]:bg-[var(--fu-line,#404040)] [&::-webkit-scrollbar-thumb:hover]:bg-[var(--fu-control-border,#737373)] [&::-webkit-scrollbar-thumb:active]:bg-[var(--fu-control-border,#737373)]\";\n"
    },
    {
      "path": "registry/ui/art-search.ts",
      "type": "registry:ui",
      "target": "@components/filters-ui/ui/art-search.ts",
      "content": "/**\n * The picture for \"nothing matches\" and \"nothing here\": a glass magnifier on a clear background, drawn 56px.\n * It is a file, not code: the shadcn install saves it as public/filters-ui/search.svg. Copying by hand, save\n * https://filtersui.com/filters-ui/search.svg there, or point this at a picture of your own. With no file the empty\n * states show their words alone.\n */\nexport const SEARCH_ART = \"/filters-ui/search.svg\";\n"
    },
    {
      "path": "registry/ui/count-pill.tsx",
      "type": "registry:ui",
      "target": "@components/filters-ui/ui/count-pill.tsx",
      "content": "\"use client\";\n\nimport type { HTMLAttributes } from \"react\";\nimport { cn } from \"../lib/cn\";\nimport { formatsFor } from \"../lib/format\";\nimport { ARRIVING, SKELETON_FILL, useLoading } from \"./skeleton\";\n\nexport type CountPillProps = Omit<HTMLAttributes<HTMLSpanElement>, \"children\"> & {\n  count: number;\n  /** \"default\": 20px high, 6px radius. \"square\": 18px high, 5px radius, 11px text. */\n  variant?: \"default\" | \"square\";\n  /** Selected look: accent fill, --fu-on-accent text. */\n  on?: boolean;\n  format?: (n: number) => string;\n  /** Formats the count when no format is given, e.g. \"de-DE\" prints 1.234. */\n  locale?: string;\n  /** A pulsing placeholder of the pill's own size. Default: the nearest StatusFrame's loading state. */\n  loading?: boolean;\n};\n\nexport function CountPill({ count, variant = \"default\", on = false, format, locale, loading: loadingProp, className, ...props }: CountPillProps) {\n  const state = useLoading();\n  const loading = loadingProp ?? state.loading;\n  const text = (format ?? formatsFor(locale).number)(count);\n  return (\n    <span\n      data-state={on ? \"on\" : \"off\"}\n      className={cn(\n        \"inline-flex shrink-0 items-center justify-center font-medium tabular-nums\",\n        \"transition-[background-color,color] duration-200 ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:transition-none\",\n        variant === \"square\"\n          ? \"h-[18px] min-w-5 rounded-[5px] px-[5px] text-[11px] leading-4\"\n          : \"h-5 min-w-[22px] rounded-[6px] px-1.5 text-[12px] leading-4\",\n        loading\n          ? SKELETON_FILL\n          : on\n            ? \"bg-[var(--fu-accent,#3B57E6)] text-[var(--fu-on-accent,#FFFFFF)]\"\n            : variant === \"square\"\n              ? \"bg-[var(--fu-pill-square,#333333)] text-[var(--fu-pill-text,#C8C8C8)]\"\n              : \"bg-[var(--fu-pill,rgb(255_255_255/0.1))] text-[var(--fu-pill-text,#C8C8C8)]\",\n        className,\n      )}\n      {...props}\n    >\n      {/* While loading, the number holds the pill's width unseen; when it arrives it fades in once. */}\n      {loading ? (\n        <span key=\"skeleton\" className=\"invisible\">\n          {text}\n        </span>\n      ) : state.arriving ? (\n        <span key=\"arrived\" className={ARRIVING}>\n          {text}\n        </span>\n      ) : (\n        text\n      )}\n    </span>\n  );\n}\n"
    },
    {
      "path": "registry/ui/skeleton.tsx",
      "type": "registry:ui",
      "target": "@components/filters-ui/ui/skeleton.tsx",
      "content": "\"use client\";\n\nimport { createContext, useContext, type HTMLAttributes, type ReactNode } from \"react\";\nimport { cn } from \"../lib/cn\";\n\n/** What StatusFrame tells the pieces under it: draw placeholders, or the data has just arrived and fades in once. */\nexport type LoadingState = { loading: boolean; arriving: boolean };\n\nexport const LoadingContext = createContext<LoadingState>({ loading: false, arriving: false });\n\n/** The loading state of the nearest StatusFrame. Outside one, nothing is loading. */\nexport const useLoading = () => useContext(LoadingContext);\n\n/**\n * The placeholder fill: --fu-skeleton, pulsing to half of it every 2s (Tailwind's animate-pulse). It holds still when\n * reduced motion is asked for, and turns to the system's grey text colour in forced colours, so it never vanishes.\n */\nexport const SKELETON_FILL =\n  \"animate-pulse bg-[var(--fu-skeleton,rgb(255_255_255/0.12))] in-data-[state=on]:bg-[var(--fu-skeleton-on,rgb(143_170_255/0.3))] motion-reduce:animate-none forced-colors:bg-[GrayText] forced-colors:[forced-color-adjust:none]\";\n\n/** Content that has just replaced a placeholder: it fades in once over 300ms as it is inserted, and never again. */\nexport const ARRIVING = \"transition-opacity duration-300 ease-out starting:opacity-0 motion-reduce:transition-none\";\n\nexport type SkeletonProps = HTMLAttributes<HTMLSpanElement>;\n\n/**\n * A pulsing placeholder block with no size of its own: give it the size and corners of what it stands for, from the\n * same classes, e.g. \"h-5 min-w-[22px] rounded-[6px]\" for a count pill. Hidden from screen readers; the StatusFrame\n * around it says \"Loading\" once.\n */\nexport function Skeleton({ className, ...props }: SkeletonProps) {\n  return <span aria-hidden=\"true\" data-skeleton=\"\" className={cn(\"block rounded-[6px]\", SKELETON_FILL, className)} {...props} />;\n}\n\nexport type SkeletonTextProps = {\n  children: ReactNode;\n  /** Draws the placeholder. Default: the nearest StatusFrame's loading state. */\n  loading?: boolean;\n  /** Classes for the placeholder's box while loading. */\n  className?: string;\n};\n\n/**\n * Words that draw as a rounded bar while loading. The words stay in the layout, unseen, so the bar is exactly as wide\n * and as many lines tall as they are, and nothing moves when they arrive; then they fade in once.\n */\nexport function SkeletonText({ children, loading, className }: SkeletonTextProps) {\n  const state = useLoading();\n  if (loading ?? state.loading) {\n    return (\n      <span key=\"skeleton\" className={cn(\"relative inline-block max-w-full align-top\", className)}>\n        <span className=\"invisible\">{children}</span>\n        <Skeleton className=\"absolute inset-x-0 inset-y-[0.22lh] rounded-[4px]\" />\n      </span>\n    );\n  }\n  if (state.arriving) {\n    return (\n      <span key=\"arrived\" className={ARRIVING}>\n        {children}\n      </span>\n    );\n  }\n  return <>{children}</>;\n}\n\n/**\n * Stand-in names for a list whose options have not come yet: a mix of lengths, so the placeholders do not read as a\n * grid. Never shown; only their widths are.\n */\nexport function placeholderLabels(count: number): string[] {\n  const words = [\"Placeholder\", \"Short\", \"A longer name\", \"Medium one\", \"Tiny\", \"Another name\", \"Middle\", \"Fairly long one\"];\n  return Array.from({ length: count }, (_, i) => words[i % words.length]);\n}\n"
    },
    {
      "path": "registry/ui/empty-state.tsx",
      "type": "registry:ui",
      "target": "@components/filters-ui/ui/empty-state.tsx",
      "content": "import type { HTMLAttributes, ReactNode } from \"react\";\nimport { cn } from \"../lib/cn\";\n\nexport type EmptyStateProps = Omit<HTMLAttributes<HTMLDivElement>, \"title\"> & {\n  /** The picture above the words: an image address, drawn 56px square, or any node of that size. */\n  art?: string | ReactNode;\n  /** The one line that says what is missing. */\n  title: ReactNode;\n  /** A link or button under the words, such as \"Clear search\". */\n  action?: ReactNode;\n  /** A second, quieter line under the title. */\n  children?: ReactNode;\n};\n\n// Each part arrives once, a beat after the one above it: the picture comes into focus, the words rise into place.\nconst ENTER =\n  \"transition-[opacity,filter,translate,scale] duration-[480ms] ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:transition-none starting:opacity-0\";\n\n/**\n * What a list shows in the room its options would take when it has none: a picture, one line and an action, stacked\n * in the middle. For a single quiet line with no picture, use EmptyNote.\n */\nexport function EmptyState({ art, title, action, className, children, ...props }: EmptyStateProps) {\n  return (\n    <div className={cn(\"flex min-w-0 max-w-full flex-col items-center text-center\", className)} {...props}>\n      {art && (\n        <span aria-hidden=\"true\" className={cn(\"mb-3 block size-14 shrink-0\", ENTER, \"starting:scale-[0.82] starting:blur-[6px]\")}>\n          {typeof art === \"string\" ? (\n            // eslint-disable-next-line @next/next/no-img-element\n            <img src={art} alt=\"\" width={56} height={56} loading=\"lazy\" decoding=\"async\" draggable={false} className=\"size-full object-contain select-none\" />\n          ) : (\n            art\n          )}\n        </span>\n      )}\n      <p dir=\"auto\" className={cn(\"max-w-full text-[15px] leading-5 font-medium text-[var(--fu-text,#F8F5F1)]\", ENTER, \"delay-[60ms] starting:translate-y-1.5 starting:blur-[2px]\")}>\n        {title}\n      </p>\n      {children && (\n        <p dir=\"auto\" className={cn(\"mt-1 max-w-full text-[14px] leading-5 text-[var(--fu-mute,#BDBDBD)]\", ENTER, \"delay-[90ms] starting:translate-y-1.5 starting:blur-[2px]\")}>\n          {children}\n        </p>\n      )}\n      {action && <div className={cn(\"mt-2 max-w-full\", ENTER, \"delay-[120ms] starting:translate-y-1.5\")}>{action}</div>}\n    </div>\n  );\n}\n"
    },
    {
      "path": "registry/ui/icons.tsx",
      "type": "registry:ui",
      "target": "@components/filters-ui/ui/icons.tsx",
      "content": "import type { ReactNode, SVGProps } from \"react\";\n\n/*\n * Icon paths from Lucide (https://lucide.dev), ISC License.\n * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT).\n * All other copyright (c) for Lucide are held by Lucide Contributors 2022.\n * Permission to use, copy, modify, and/or distribute this software for any purpose with or\n * without fee is hereby granted, provided that the above copyright notice and this permission\n * notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS\n * SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE\n * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,\n * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\nexport type IconProps = Omit<SVGProps<SVGSVGElement>, \"children\"> & { size?: number };\n\nfunction Icon({ size = 20, strokeWidth = 2, children, ...props }: IconProps & { children: ReactNode }) {\n  return (\n    <svg\n      width={size}\n      height={size}\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      strokeWidth={strokeWidth}\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n      aria-hidden=\"true\"\n      focusable=\"false\"\n      {...props}\n    >\n      {children}\n    </svg>\n  );\n}\n\nexport function ChevronDownIcon(props: IconProps) {\n  return (\n    <Icon {...props}>\n      <path d=\"m6 9 6 6 6-6\" />\n    </Icon>\n  );\n}\n\nexport function XIcon(props: IconProps) {\n  return (\n    <Icon {...props}>\n      <path d=\"M18 6 6 18\" />\n      <path d=\"m6 6 12 12\" />\n    </Icon>\n  );\n}\n\nexport function CheckIcon(props: IconProps) {\n  return (\n    <Icon {...props}>\n      <path d=\"M20 6 9 17l-5-5\" />\n    </Icon>\n  );\n}\n\nexport function SearchIcon(props: IconProps) {\n  return (\n    <Icon {...props}>\n      <circle cx=\"11\" cy=\"11\" r=\"8\" />\n      <path d=\"m21 21-4.3-4.3\" />\n    </Icon>\n  );\n}\n\nexport function ArrowUpRightIcon(props: IconProps) {\n  return (\n    <Icon {...props}>\n      <path d=\"M7 7h10v10\" />\n      <path d=\"M7 17 17 7\" />\n    </Icon>\n  );\n}\n\nexport function PlusIcon(props: IconProps) {\n  return (\n    <Icon {...props}>\n      <path d=\"M5 12h14\" />\n      <path d=\"M12 5v14\" />\n    </Icon>\n  );\n}\n\nexport function CopyIcon(props: IconProps) {\n  return (\n    <Icon {...props}>\n      <rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\" />\n      <path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\" />\n    </Icon>\n  );\n}\n\nexport function SlidersIcon(props: IconProps) {\n  return (\n    <Icon {...props}>\n      <path d=\"M21 4h-7\" />\n      <path d=\"M10 4H3\" />\n      <path d=\"M21 12h-9\" />\n      <path d=\"M8 12H3\" />\n      <path d=\"M21 20h-5\" />\n      <path d=\"M12 20H3\" />\n      <path d=\"M14 2v4\" />\n      <path d=\"M8 10v4\" />\n      <path d=\"M16 18v4\" />\n    </Icon>\n  );\n}\n\nexport function ArrowRightIcon(props: IconProps) {\n  return (\n    <Icon {...props}>\n      <path d=\"M5 12h14\" />\n      <path d=\"m12 5 7 7-7 7\" />\n    </Icon>\n  );\n}\n\nexport function SearchXIcon(props: IconProps) {\n  return (\n    <Icon {...props}>\n      <path d=\"m13.5 8.5-5 5\" />\n      <path d=\"m8.5 8.5 5 5\" />\n      <circle cx=\"11\" cy=\"11\" r=\"8\" />\n      <path d=\"m21 21-4.3-4.3\" />\n    </Icon>\n  );\n}\n\nexport function StarIcon(props: IconProps) {\n  return (\n    <Icon {...props}>\n      <path d=\"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z\" />\n    </Icon>\n  );\n}\n\nexport function HistoryIcon(props: IconProps) {\n  return (\n    <Icon {...props}>\n      <path d=\"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\" />\n      <path d=\"M3 3v5h5\" />\n      <path d=\"M12 7v5l4 2\" />\n    </Icon>\n  );\n}\n\nexport function ListTreeIcon(props: IconProps) {\n  return (\n    <Icon {...props}>\n      <path d=\"M21 12h-8\" />\n      <path d=\"M21 6H8\" />\n      <path d=\"M21 18h-8\" />\n      <path d=\"M3 6v4c0 1.1.9 2 2 2h3\" />\n      <path d=\"M3 10v6c0 1.1.9 2 2 2h3\" />\n    </Icon>\n  );\n}\n\nexport function CircleAlertIcon(props: IconProps) {\n  return (\n    <Icon {...props}>\n      <circle cx=\"12\" cy=\"12\" r=\"10\" />\n      <path d=\"M12 8v4\" />\n      <path d=\"M12 16h.01\" />\n    </Icon>\n  );\n}\n"
    },
    {
      "path": "registry/ui/status-frame.tsx",
      "type": "registry:ui",
      "target": "@components/filters-ui/ui/status-frame.tsx",
      "content": "\"use client\";\n\nimport { createContext, useContext, useEffect, useLayoutEffect, useRef, useState, type HTMLAttributes, type ReactNode, type RefObject } from \"react\";\nimport { cn } from \"../lib/cn\";\nimport { SEARCH_ART } from \"./art-search\";\nimport { EmptyNote } from \"./empty-note\";\nimport { EmptyState } from \"./empty-state\";\nimport { ERROR_LINE, ERROR_TEXT, ErrorGlyph, RetryButton } from \"./inline-error\";\nimport { LoadingContext, useLoading } from \"./skeleton\";\n\n/** Where the data stands: shown, on its way, or failed. */\nexport type Status = \"ready\" | \"loading\" | \"error\";\n\n/**\n * The state props every item takes, with the same names and meanings everywhere, so a person who has learned one\n * filter knows them all. Spread them into an item's own props type.\n */\nexport type StateProps = {\n  /** \"loading\" draws placeholders the size of the content; \"error\" shows errorText with a Retry. Default \"ready\". */\n  status?: Status;\n  /** Called by the Retry button. Without it the error line has no button. */\n  onRetry?: () => void;\n  /** The error line. Default \"Couldn't load the options.\" */\n  errorText?: string;\n  /** The line shown in place of the options when there are none. Default \"No options to show\" */\n  emptyText?: string;\n  /** Dims the whole filter, blocks pointer and keyboard input and says so to screen readers. Default false. */\n  disabled?: boolean;\n};\n\nexport const DEFAULT_ERROR_TEXT = \"Couldn't load the options.\";\nexport const DEFAULT_EMPTY_TEXT = \"No options to show\";\nexport const DEFAULT_LOADING_TEXT = \"Loading\";\n\n/** How long arriving content keeps its fade-in class: a little more than the 300ms fade. */\nconst ARRIVAL_MS = 400;\n\ntype Mode = \"ready\" | \"loading\" | \"error\" | \"empty\";\n\n/** A frame around this one is loading and has said \"Loading\": this one then draws its placeholders without saying it again. */\nconst SaidLoading = createContext(false);\n\nexport type StatusFrameProps = Omit<HTMLAttributes<HTMLDivElement>, \"children\"> &\n  Omit<StateProps, \"emptyText\"> & {\n    /** There are no options: emptyText shows in place of the content. */\n    empty?: boolean;\n    emptyText?: ReactNode;\n    /** The picture above emptyText: an image address or a node. Default: the search picture. null draws the words alone as one quiet line, for a tight place. */\n    emptyArt?: string | ReactNode | null;\n    /** Words read once while loading. Default \"Loading\". */\n    loadingText?: string;\n    /** Reads loading and errors out. A block that holds several filters turns it off on each and says it once itself. Default true. */\n    announce?: boolean;\n    retryLabel?: string;\n    children: ReactNode;\n  };\n\n/**\n * Wraps an item's content and gives it the shared states.\n * - loading: the content stays drawn, inert and busy, and its Skeleton, SkeletonText and CountPill pieces draw as\n *   placeholders of their real size, so nothing moves when the data arrives; the data then fades in once.\n * - error: one calm line and a Retry in place of the content. Loading and errors are read out through one polite\n *   status region that stays on the page.\n * - empty: a picture and one line in place of the content (or the line alone, with emptyArt null).\n * - disabled: dimmed, no pointer or keyboard input (a disabled fieldset turns off every native control inside), and\n *   read as unavailable. Custom focusable parts, such as a grid's cells, also need tabIndex -1 and aria-disabled.\n * When a state change takes away the control that had focus, the frame takes focus, so it is never lost.\n * A frame inside a loading frame draws its placeholders too, and does not say \"Loading\" again when that frame has said\n * it. So a block can load every filter in it with one quiet frame per card (announce false) and say it once in its head\n * with StatusLine; and a filter whose error must leave its title in place can take loading and disabled on a quiet outer\n * frame and let an inner frame around the part that fails speak.\n */\nexport function StatusFrame({\n  status = \"ready\",\n  onRetry,\n  errorText = DEFAULT_ERROR_TEXT,\n  empty = false,\n  emptyText = DEFAULT_EMPTY_TEXT,\n  emptyArt,\n  disabled = false,\n  loadingText = DEFAULT_LOADING_TEXT,\n  announce = true,\n  retryLabel,\n  className,\n  children,\n  ...props\n}: StatusFrameProps) {\n  const frame = useRef<HTMLDivElement>(null);\n  const outer = useLoading();\n  const saidAbove = useContext(SaidLoading);\n  const mode: Mode = status === \"loading\" ? \"loading\" : status === \"error\" ? \"error\" : empty ? \"empty\" : \"ready\";\n\n  // The data arrives when loading turns to ready: its pieces fade in once, then go back to plain content.\n  const [lastStatus, setLastStatus] = useState(status);\n  const [arriving, setArriving] = useState(false);\n  if (status !== lastStatus) {\n    setLastStatus(status);\n    setArriving(lastStatus === \"loading\" && status === \"ready\");\n  }\n  useEffect(() => {\n    if (!arriving) return;\n    const timer = setTimeout(() => setArriving(false), ARRIVAL_MS);\n    return () => clearTimeout(timer);\n  }, [arriving]);\n\n  // Whether focus sat on a control inside, read just before a change of state is drawn.\n  const key = `${mode}|${disabled}`;\n  const drawnKey = useRef(key);\n  const focusWasInside = useRef(false);\n  if (key !== drawnKey.current && typeof document !== \"undefined\") {\n    const active = document.activeElement;\n    focusWasInside.current = !!frame.current && !!active && active !== frame.current && frame.current.contains(active);\n  }\n  useLayoutEffect(() => {\n    if (drawnKey.current === key) return;\n    drawnKey.current = key;\n    if (!focusWasInside.current) return;\n    focusWasInside.current = false;\n    const node = frame.current;\n    // The focused control was removed, made inert or disabled: the frame keeps focus instead of the page.\n    if (node && (mode !== \"ready\" || disabled || !node.contains(document.activeElement))) node.focus({ preventScroll: true });\n  });\n\n  return (\n    <div\n      ref={frame}\n      tabIndex={-1}\n      data-status-frame=\"\"\n      data-status={mode}\n      aria-busy={mode === \"loading\" || undefined}\n      className={cn(\n        \"min-w-0 rounded-[12px] outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-solid focus-visible:outline-[var(--fu-accent-soft,#8FAAFF)]\",\n        disabled && \"pointer-events-none opacity-50 select-none\",\n        className,\n      )}\n      {...props}\n    >\n      <SaidLoading.Provider value={saidAbove || (mode === \"loading\" && announce)}>\n        <LoadingContext.Provider value={{ loading: mode === \"loading\" || outer.loading, arriving: arriving || outer.arriving }}>\n          {mode === \"empty\" ? (\n            emptyArt === null ? (\n              <EmptyNote>{emptyText}</EmptyNote>\n            ) : (\n              <EmptyState art={emptyArt ?? SEARCH_ART} title={emptyText} className=\"py-5\" />\n            )\n          ) : mode === \"error\" ? null : (\n            // display: contents, so the fieldset adds no box; while disabled it turns off every native control inside.\n            <fieldset role=\"none\" disabled={disabled} inert={mode === \"loading\"} className=\"contents\">\n              {children}\n            </fieldset>\n          )}\n        </LoadingContext.Provider>\n      </SaidLoading.Provider>\n      <StatusLine\n        status={mode === \"loading\" || mode === \"error\" ? mode : \"ready\"}\n        onRetry={onRetry}\n        errorText={errorText}\n        loadingText={saidAbove ? \"\" : loadingText}\n        announce={announce}\n        retryLabel={retryLabel}\n      />\n    </div>\n  );\n}\n\nexport type StatusLineProps = {\n  status?: Status;\n  /** Called by Retry. Without it the error line has no button. */\n  onRetry?: () => void;\n  errorText?: string;\n  loadingText?: string;\n  /** Reads loading and errors out. Off, it leaves \"Loading\" out and still shows an error. Default true. */\n  announce?: boolean;\n  retryLabel?: string;\n  /** Classes for the line while it shows an error, e.g. its margins. */\n  className?: string;\n};\n\n/**\n * What a StatusFrame says, on its own: one polite region, on the page in every state so each change is read out.\n * Loading is read as \"Loading\" and not shown; an error shows as one calm line with Retry; ready says nothing and takes\n * no space. A block that keeps its cards in every state puts it in its head, to say the state once for all of them.\n * Retry hands focus to the nearest element marked data-status-frame (with tabIndex -1) around it.\n */\nexport function StatusLine({\n  status = \"ready\",\n  onRetry,\n  errorText = DEFAULT_ERROR_TEXT,\n  loadingText = DEFAULT_LOADING_TEXT,\n  announce = true,\n  retryLabel,\n  className,\n}: StatusLineProps) {\n  const error = status === \"error\";\n  const said = status === \"loading\" ? (announce ? loadingText : \"\") : error ? errorText : \"\";\n  return (\n    // The words take their own direction, so an English sentence keeps its full stop at its end on a right-to-left page.\n    <div className={error ? cn(ERROR_LINE, className) : \"contents\"}>\n      <p role={announce ? \"status\" : undefined} className={error ? ERROR_TEXT : \"sr-only\"}>\n        {error && <ErrorGlyph />}\n        {said && <span dir=\"auto\">{said}</span>}\n      </p>\n      {error && onRetry && <RetryButton onRetry={onRetry} label={retryLabel} />}\n    </div>\n  );\n}\n\n/**\n * For a block that leaves controls out by state, such as Clear all while it is disabled: when a change of `key` takes\n * away the control that had focus inside `scope`, `target` (default `scope`, with tabIndex -1) takes focus, so it is\n * never dropped to the page.\n */\nexport function useFocusKept(scope: RefObject<HTMLElement | null>, key: string, target: RefObject<HTMLElement | null> = scope) {\n  const drawn = useRef(key);\n  const had = useRef(false);\n  if (key !== drawn.current && typeof document !== \"undefined\") {\n    const active = document.activeElement;\n    had.current = !!scope.current && !!active && scope.current.contains(active);\n  }\n  useLayoutEffect(() => {\n    if (drawn.current === key) return;\n    drawn.current = key;\n    if (!had.current) return;\n    had.current = false;\n    const node = scope.current;\n    if (node && !node.contains(document.activeElement)) target.current?.focus({ preventScroll: true });\n  });\n}\n"
    },
    {
      "path": "registry/ui/empty-note.tsx",
      "type": "registry:ui",
      "target": "@components/filters-ui/ui/empty-note.tsx",
      "content": "import type { HTMLAttributes, ReactNode } from \"react\";\nimport { cn } from \"../lib/cn\";\n\nexport type EmptyNoteProps = HTMLAttributes<HTMLDivElement> & {\n  /** A 16px glyph in currentColor before the words. */\n  icon?: ReactNode;\n  /** A button or link after the words, e.g. \"Clear search\". */\n  action?: ReactNode;\n};\n\n/**\n * A quiet one-line note in place of a list that has nothing in it: dim 14px words, an optional glyph and an optional\n * action. No illustration and no box, so it sits in the space the options would take.\n */\nexport function EmptyNote({ icon, action, className, children, ...props }: EmptyNoteProps) {\n  return (\n    <div className={cn(\"flex min-w-0 flex-wrap items-center justify-between gap-x-3 gap-y-2\", className)} {...props}>\n      <p className=\"flex min-w-0 items-start gap-2 text-[14px] leading-5 text-[var(--fu-dim,#929292)]\">\n        {icon && (\n          <span aria-hidden=\"true\" className=\"mt-0.5 shrink-0 [&_svg]:size-4\">\n            {icon}\n          </span>\n        )}\n        <span dir=\"auto\">{children}</span>\n      </p>\n      {action}\n    </div>\n  );\n}\n"
    },
    {
      "path": "registry/ui/inline-error.tsx",
      "type": "registry:ui",
      "target": "@components/filters-ui/ui/inline-error.tsx",
      "content": "\"use client\";\n\nimport type { HTMLAttributes } from \"react\";\nimport { cn } from \"../lib/cn\";\nimport { buttonClasses } from \"./button-classes\";\nimport { CircleAlertIcon } from \"./icons\";\n\nexport const DEFAULT_RETRY_LABEL = \"Retry\";\n\n/** The error line's layout: the words at the start, Retry at the end, wrapping under them when space runs out. */\nexport const ERROR_LINE = \"flex min-w-0 flex-wrap items-center justify-between gap-x-3 gap-y-2\";\n/** The words: 14px, muted, with a 16px dim alert glyph before them. */\nexport const ERROR_TEXT = \"flex min-w-0 items-start gap-2 text-[14px] leading-5 text-[var(--fu-mute,#BDBDBD)]\";\n\n/** The alert glyph that leads the words. Hidden from screen readers. */\nexport function ErrorGlyph() {\n  return <CircleAlertIcon size={16} className=\"mt-0.5 shrink-0 text-[var(--fu-dim,#929292)]\" />;\n}\n\nexport type RetryButtonProps = {\n  onRetry: () => void;\n  label?: string;\n  className?: string;\n};\n\n/**\n * A small grey button that is never shown disabled. Before it calls onRetry it hands focus to the StatusFrame around\n * it, which stays on the page while the content reloads, so focus is never lost with the button.\n */\nexport function RetryButton({ onRetry, label = DEFAULT_RETRY_LABEL, className }: RetryButtonProps) {\n  return (\n    <button\n      type=\"button\"\n      onClick={(event) => {\n        event.currentTarget.closest<HTMLElement>(\"[data-status-frame]\")?.focus({ preventScroll: true });\n        onRetry();\n      }}\n      className={buttonClasses({ variant: \"secondary\", size: \"sm\", className })}\n    >\n      {label}\n    </button>\n  );\n}\n\nexport type InlineErrorProps = Omit<HTMLAttributes<HTMLDivElement>, \"children\"> & {\n  /** One short line in plain words, e.g. \"Couldn't load the options.\" */\n  text: string;\n  /** Shows Retry. Without it the line stands alone. */\n  onRetry?: () => void;\n  retryLabel?: string;\n};\n\n/**\n * A calm error in the component's own area: one muted line and a Retry button. The line is a polite status region, so\n * it is read out when it appears. Inside a StatusFrame use the frame's status=\"error\" instead: it keeps one region on\n * the page for loading and errors alike.\n */\nexport function InlineError({ text, onRetry, retryLabel, className, ...props }: InlineErrorProps) {\n  return (\n    <div className={cn(ERROR_LINE, className)} {...props}>\n      <p role=\"status\" className={ERROR_TEXT}>\n        <ErrorGlyph />\n        <span dir=\"auto\">{text}</span>\n      </p>\n      {onRetry && <RetryButton onRetry={onRetry} label={retryLabel} />}\n    </div>\n  );\n}\n"
    },
    {
      "path": "registry/ui/button-classes.ts",
      "type": "registry:ui",
      "target": "@components/filters-ui/ui/button-classes.ts",
      "content": "import { cn } from \"../lib/cn\";\n\n// The button looks as class names. Kept apart from button.tsx, a client module, so server pages can call them too.\n\nexport type ButtonVariant = \"primary\" | \"secondary\" | \"ghost\" | \"quiet\" | \"quiet-accent\";\nexport type ButtonSize = \"sm\" | \"md\" | \"lg\";\n\nexport const BUTTON_BASE = cn(\n  \"relative inline-flex shrink-0 cursor-pointer items-center justify-center rounded-[10px] font-[inherit] font-medium whitespace-nowrap no-underline select-none\",\n  \"[-webkit-tap-highlight-color:transparent] transition-[background-color,color,scale] duration-200 ease-[cubic-bezier(0.22,1,0.36,1)]\",\n  \"active:scale-[0.97] active:duration-75 motion-reduce:transition-none motion-reduce:active:scale-100\",\n  \"outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-solid focus-visible:outline-[var(--fu-accent-soft,#8FAAFF)]\",\n  \"aria-busy:cursor-progress aria-busy:active:scale-100\",\n);\n\nconst VARIANTS: Record<ButtonVariant, string> = {\n  primary:\n    \"bg-[var(--fu-accent,#3B57E6)] text-[var(--fu-on-accent,#FFFFFF)] hover:bg-[var(--fu-accent-hover,#3450D4)] forced-colors:border forced-colors:border-[ButtonText]\",\n  secondary:\n    \"bg-[var(--fu-surface-3,#2A2A2A)] text-[var(--fu-text,#F8F5F1)] hover:bg-[var(--fu-hover,#333333)] forced-colors:border forced-colors:border-[ButtonText]\",\n  ghost: \"bg-transparent text-[var(--fu-text,#F8F5F1)] hover:bg-[var(--fu-hover-wash,rgb(255_255_255/0.14))]\",\n  quiet: \"bg-transparent text-[var(--fu-mute,#BDBDBD)] hover:text-[var(--fu-text,#F8F5F1)]\",\n  \"quiet-accent\":\n    \"bg-transparent text-[var(--fu-accent-soft,#8FAAFF)] decoration-1 underline-offset-[5px] hover:text-[var(--fu-accent-pale,#D1DDFF)] [@media(hover:hover)]:hover:underline\",\n};\n\n// Below 44px a touch screen gets a taller invisible target through ::after.\nconst TAP = \"pointer-coarse:after:absolute pointer-coarse:after:inset-x-0 pointer-coarse:after:content-['']\";\n\nconst SIZES: Record<ButtonSize, { box: string; before: string; after: string }> = {\n  sm: { box: cn(\"h-8 gap-1.5 px-3 text-[13px] leading-5 [&_svg]:size-4\", TAP, \"pointer-coarse:after:-inset-y-1.5\"), before: \"ps-2.5\", after: \"pe-2.5\" },\n  md: { box: cn(\"h-10 gap-2 px-3.5 text-[15px] leading-5 [&_svg]:size-4\", TAP, \"pointer-coarse:after:-inset-y-0.5\"), before: \"ps-3\", after: \"pe-3\" },\n  lg: { box: \"h-11 gap-2 px-4 text-[15px] leading-5 [&_svg]:size-[18px]\", before: \"ps-3.5\", after: \"pe-3.5\" },\n};\n\n/** The classes of a button, for a link or a router link that should look like one. */\nexport function buttonClasses({\n  variant = \"primary\",\n  size = \"md\",\n  before = false,\n  after = false,\n  className,\n}: { variant?: ButtonVariant; size?: ButtonSize; before?: boolean; after?: boolean; className?: string } = {}) {\n  return cn(BUTTON_BASE, VARIANTS[variant], SIZES[size].box, before && SIZES[size].before, after && SIZES[size].after, className);\n}\n"
    },
    {
      "path": "registry/ui/text-field.tsx",
      "type": "registry:ui",
      "target": "@components/filters-ui/ui/text-field.tsx",
      "content": "\"use client\";\n\nimport { useRef, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { cn } from \"../lib/cn\";\nimport { DragHandle, type NumberDrag } from \"./drag-handle\";\nimport { XIcon } from \"./icons\";\nimport { ARRIVING, Skeleton, useLoading } from \"./skeleton\";\n\nexport type TextFieldProps = Omit<InputHTMLAttributes<HTMLInputElement>, \"value\" | \"onChange\" | \"prefix\" | \"size\"> & {\n  value: string;\n  onChange: (value: string) => void;\n  /** Accessible name. Shown only to screen readers; the placeholder is the visible label. */\n  label: string;\n  /** Text or an icon before the value, e.g. \"$\". */\n  prefix?: ReactNode;\n  /** Shows a 16px clear button while the field has a value. Defaults to emptying the value. */\n  onClear?: () => void;\n  clearLabel?: string;\n  /** For a field that holds a number: a handle to drag it along a scale, as on a slider. See DragHandle. */\n  drag?: NumberDrag;\n  className?: string;\n  inputClassName?: string;\n};\n\n/** 44px field, 12px radius, 1px --fu-field-border border, 15px text, optional prefix and clear X. */\nexport function TextField({\n  value,\n  onChange,\n  label,\n  prefix,\n  onClear,\n  clearLabel,\n  drag,\n  className,\n  inputClassName,\n  disabled,\n  ...props\n}: TextFieldProps) {\n  const input = useRef<HTMLInputElement>(null);\n  const filled = value.length > 0;\n  // Inside a loading StatusFrame the box stays and a bar stands in for the words, which fade in once when they arrive.\n  const { loading, arriving } = useLoading();\n\n  return (\n    <div\n      className={cn(\n        \"flex h-11 min-w-0 items-center gap-1.5 rounded-[12px] border border-[var(--fu-field-border,#737373)] bg-[var(--fu-input,rgb(0_0_0/0))] px-3\",\n        \"text-[15px] leading-5 text-[var(--fu-text,#F8F5F1)] transition-[border-color,box-shadow] duration-200 motion-reduce:transition-none\",\n        \"hover:border-[var(--fu-control-hover,#A3A3A3)] focus-within:border-[var(--fu-accent-soft,#8FAAFF)] focus-within:hover:border-[var(--fu-accent-soft,#8FAAFF)]\",\n        \"focus-within:shadow-[inset_0_0_0_1px_var(--fu-accent-soft,#8FAAFF)]\",\n        disabled && \"pointer-events-none opacity-50\",\n        drag && \"group/field relative isolate\",\n        className,\n      )}\n      onPointerDown={(event) => {\n        if (event.target === event.currentTarget) {\n          event.preventDefault();\n          input.current?.focus();\n        }\n      }}\n    >\n      {prefix != null && <span className=\"shrink-0 text-[var(--fu-mute,#BDBDBD)]\">{prefix}</span>}\n      {loading && <Skeleton className=\"h-3 w-[45%] max-w-28 rounded-[4px]\" />}\n      <input\n        key={loading ? \"loading\" : \"ready\"}\n        ref={input}\n        value={value}\n        onChange={(event) => onChange(event.target.value)}\n        aria-label={label}\n        disabled={disabled}\n        className={cn(\n          \"h-full min-w-0 flex-1 bg-transparent text-ellipsis text-inherit tabular-nums outline-none\",\n          \"placeholder:text-[var(--fu-mute,#BDBDBD)]\",\n          inputClassName,\n          loading && \"sr-only\",\n          arriving && ARRIVING,\n        )}\n        {...props}\n      />\n      {filled && !loading && (\n        <button\n          type=\"button\"\n          aria-label={clearLabel ?? `Clear ${label.toLowerCase()}`}\n          onClick={() => {\n            if (onClear) onClear();\n            else onChange(\"\");\n            input.current?.focus();\n          }}\n          className={cn(\n            // Above the drag handle's layer, so the cross can always be pressed.\n            \"relative z-[1] -me-1 grid size-6 shrink-0 cursor-pointer place-items-center rounded-[6px] text-[var(--fu-mute,#BDBDBD)]\",\n            \"transition-colors duration-150 hover:text-[var(--fu-text,#F8F5F1)]\",\n            \"focus-visible:outline-2 focus-visible:outline-offset-0 focus-visible:outline-[var(--fu-accent-soft,#8FAAFF)]\",\n          )}\n        >\n          <XIcon size={16} />\n        </button>\n      )}\n      {drag && !loading && !disabled && <DragHandle drag={drag} input={input} />}\n    </div>\n  );\n}\n"
    },
    {
      "path": "registry/ui/drag-handle.tsx",
      "type": "registry:ui",
      "target": "@components/filters-ui/ui/drag-handle.tsx",
      "content": "\"use client\";\n\nimport { useEffect, useRef, useState, type CSSProperties, type PointerEvent, type RefObject } from \"react\";\nimport { cn } from \"../lib/cn\";\nimport { isRtl } from \"../lib/direction\";\n\nexport type NumberDrag = {\n  /** The number the field holds; null while it is empty. */\n  value: number | null;\n  /** The scale the field's width stands for. */\n  min: number;\n  max: number;\n  /** Dragged values snap to this. */\n  step: number;\n  onChange: (value: number) => void;\n  /** Where the handle stands while the field is empty. Default \"min\". */\n  emptyAt?: \"min\" | \"max\";\n  /** The lowest and highest value a drag may reach, inside min and max: the other end of a range, say. */\n  floor?: number;\n  ceiling?: number;\n  /**\n   * Called on each move of a drag with the value under the pointer, before it snaps to a step, and with null when the\n   * handle is let go: for a chart that should move with the handle.\n   */\n  onHold?: (value: number | null) => void;\n};\n\ntype Press = { start: number; width: number; rtl: boolean; grab: number; x: number; last: number | null; moved: boolean; settled: boolean };\n\n/**\n * Turns a number field into a slider as well. With a mouse over the field a thin handle shows where the value stands\n * along the field's width; dragging it fills the field up to the handle and moves the value in steps. A press that does\n * not move puts the caret in the field instead, with its text picked. The field needs the classes \"group/field relative\n * isolate\": the fill and the handle are drawn behind its text, and only a strip over the handle takes the pointer.\n * While a drag runs the layer carries data-dragging, which a field that grows with its text can use to hold its width.\n * With the pointer on the handle itself it grows and takes the accent colour, as it does while dragged, so it reads as\n * the thing to grab. The accent keeps the digits it crosses readable, which a light handle would not.\n */\nexport function DragHandle({ drag, input, pad = 12 }: { drag: NumberDrag; input: RefObject<HTMLInputElement | null>; pad?: number }) {\n  const { value, min, max, step, onChange, emptyAt = \"min\" } = drag;\n  const strip = useRef<HTMLSpanElement>(null);\n  const press = useRef<Press | null>(null);\n  const [dragging, setDragging] = useState(false);\n  const [near, setNear] = useState(false);\n  const hold = useRef(drag.onHold);\n  hold.current = drag.onHold;\n\n  const span = max - min || 1;\n  const share = (n: number) => Math.min(1, Math.max(0, (n - min) / span));\n  const at = share(value ?? (emptyAt === \"max\" ? max : min));\n  // A CSS variable set on the field while dragging takes over from the value, so the handle follows the pointer between steps.\n  const place = `calc(${pad}px + var(--drag-at, ${at}) * (100% - ${pad * 2}px))`;\n\n  const pointerShare = (x: number, p: Press) => {\n    const f = (x - p.start) / p.width;\n    return p.rtl ? 1 - f : f;\n  };\n  /** Takes the field's box as it is now and keeps the handle where the pointer holds it. */\n  const measure = (p: Press, x: number, held: number) => {\n    const box = strip.current?.parentElement?.getBoundingClientRect();\n    if (!box) return;\n    p.start = box.left + pad;\n    p.width = Math.max(1, box.width - pad * 2);\n    p.grab = pointerShare(x, p) - held;\n  };\n\n  // A drag cut short by the field going away (loading, disabled) must not leave its place on the field.\n  useEffect(() => {\n    const field = strip.current?.parentElement;\n    return () => {\n      field?.style.removeProperty(\"--drag-at\");\n      if (press.current?.moved) hold.current?.(null);\n    };\n  }, []);\n\n  const down = (event: PointerEvent<HTMLSpanElement>) => {\n    // A frame turns its filter off with a disabled fieldset; the strip is no control, so it asks the field.\n    if (event.button !== 0 || !strip.current || input.current?.matches(\":disabled\")) return;\n    // Keeps the press from starting a text selection or moving focus; a press that never moves focuses the field on release.\n    event.preventDefault();\n    const p: Press = { start: 0, width: 1, rtl: isRtl(strip.current), grab: 0, x: event.clientX, last: value, moved: false, settled: false };\n    measure(p, event.clientX, at);\n    press.current = p;\n    event.currentTarget.setPointerCapture(event.pointerId);\n  };\n\n  const move = (event: PointerEvent<HTMLSpanElement>) => {\n    const p = press.current;\n    if (!p) return;\n    if (!p.moved) {\n      if (Math.abs(event.clientX - p.x) < 3) return;\n      // A field that grows with its text takes its widest size for the drag (see data-dragging); the next move\n      // measures it at that size, so the handle stays under the pointer from then on.\n      p.moved = true;\n      setDragging(true);\n      return;\n    }\n    if (!p.settled) {\n      p.settled = true;\n      measure(p, event.clientX, share(p.last ?? (emptyAt === \"max\" ? max : min)));\n    }\n    const floor = drag.floor ?? min;\n    const ceiling = drag.ceiling ?? max;\n    const to = Math.min(share(ceiling), Math.max(share(floor), pointerShare(event.clientX, p) - p.grab));\n    strip.current?.parentElement?.style.setProperty(\"--drag-at\", String(to));\n    drag.onHold?.(min + to * span);\n    // Snapped to the step, kept between the floor and the ceiling (a typed floor may sit off the steps), and written\n    // with the step's own decimals, so 0.1 steps do not come out as 0.30000000000000004.\n    const snapped = Math.min(ceiling, Math.max(floor, min + Math.round((to * span) / step) * step));\n    const next = Number(snapped.toFixed((String(step).split(\".\")[1] ?? \"\").length));\n    if (next !== p.last) {\n      p.last = next;\n      onChange(next);\n    }\n  };\n\n  const up = (event: PointerEvent<HTMLSpanElement>, cancelled = false) => {\n    const p = press.current;\n    if (!p) return;\n    press.current = null;\n    strip.current?.parentElement?.style.removeProperty(\"--drag-at\");\n    if (event.currentTarget.hasPointerCapture(event.pointerId)) event.currentTarget.releasePointerCapture(event.pointerId);\n    setDragging(false);\n    if (p.moved) drag.onHold?.(null);\n    if (!p.moved && !cancelled) {\n      input.current?.focus();\n      input.current?.select();\n    }\n  };\n\n  return (\n    <>\n      <span\n        aria-hidden=\"true\"\n        data-dragging={dragging || undefined}\n        data-near={near || dragging || undefined}\n        className=\"group/drag pointer-events-none absolute inset-0 -z-10 overflow-hidden rounded-[inherit]\"\n      >\n        <span\n          className=\"absolute inset-y-0 inset-s-0 bg-[var(--fu-wash,rgb(255_255_255/0.08))] opacity-0 transition-opacity duration-200 motion-reduce:transition-none group-data-[dragging]/drag:opacity-100\"\n          style={{ width: place }}\n        />\n        <span\n          // Centred on its place with a start margin, which follows the field's own direction: a left-to-right\n          // number pill keeps it right inside a right-to-left page, where a mirrored translate would not.\n          className={cn(\n            \"absolute top-1/2 -ms-[1.5px] h-5 w-[3px] -translate-y-1/2 rounded-full bg-[var(--fu-control-border,#737373)] opacity-0 in-[fieldset:disabled]:hidden\",\n            \"transition-[opacity,background-color,scale] duration-150 motion-reduce:transition-none forced-colors:bg-[CanvasText]\",\n            \"pointer-fine:group-hover/field:opacity-100 group-data-[near]/drag:bg-[var(--fu-accent,#3B57E6)] group-data-[near]/drag:opacity-100\",\n            \"group-data-[near]/drag:scale-x-150 group-data-[near]/drag:scale-y-125\",\n          )}\n          style={{ insetInlineStart: place } as CSSProperties}\n        />\n      </span>\n      <span\n        ref={strip}\n        aria-hidden=\"true\"\n        onPointerDown={down}\n        onPointerMove={move}\n        onPointerUp={(event) => up(event)}\n        onPointerCancel={(event) => up(event, true)}\n        onPointerEnter={() => setNear(true)}\n        onPointerLeave={() => setNear(false)}\n        // Inside a <label> a click would hand focus to the field after a drag; focus is given on release instead.\n        onClick={(event) => event.preventDefault()}\n        className=\"pointer-events-none absolute inset-y-0 -ms-2 w-4 cursor-ew-resize touch-none in-[fieldset:disabled]:hidden pointer-fine:pointer-events-auto\"\n        style={{ insetInlineStart: place } as CSSProperties}\n      />\n    </>\n  );\n}\n"
    },
    {
      "path": "registry/lib/direction.ts",
      "type": "registry:lib",
      "target": "@components/filters-ui/lib/direction.ts",
      "content": "// Right-to-left helpers for positions and keys worked out in script. Each reads the direction from the element\n// itself, so it is right when only a parent sets dir=\"rtl\".\n\n/** True when the element lays out right to left. */\nexport const isRtl = (node: Element | null | undefined) => !!node && getComputedStyle(node).direction === \"rtl\";\n\n/**\n * The arrow key as a step in reading order: in right-to-left, ArrowLeft moves forward and ArrowRight back, as the\n * ARIA patterns ask for horizontal widgets. Every other key comes back as it is.\n */\nexport function readingKey(key: string, node: Element | null | undefined): string {\n  if ((key !== \"ArrowLeft\" && key !== \"ArrowRight\") || !isRtl(node)) return key;\n  return key === \"ArrowLeft\" ? \"ArrowRight\" : \"ArrowLeft\";\n}\n\n/** A child's offset from its offset parent's start edge: its offsetLeft, or the distance from the right in RTL. */\nexport function startOffset(node: HTMLElement): number {\n  if (!isRtl(node)) return node.offsetLeft;\n  const parent = node.offsetParent as HTMLElement | null;\n  return (parent?.clientWidth ?? 0) - node.offsetLeft - node.offsetWidth;\n}\n\n/** Calls back whenever a dir attribute on the page changes, so a position measured in script can be taken again. */\nexport function onDirChange(callback: () => void): () => void {\n  if (typeof MutationObserver === \"undefined\") return () => {};\n  const observer = new MutationObserver(callback);\n  observer.observe(document.documentElement, { attributes: true, attributeFilter: [\"dir\"], subtree: true });\n  return () => observer.disconnect();\n}\n"
    },
    {
      "path": "registry/ui/filter-card.tsx",
      "type": "registry:ui",
      "target": "@components/filters-ui/ui/filter-card.tsx",
      "content": "\"use client\";\n\nimport { useId, useRef, useState, type HTMLAttributes, type ReactNode } from \"react\";\nimport { cn } from \"../lib/cn\";\nimport { ChevronDownIcon } from \"./icons\";\n\nexport type FilterCardProps = Omit<HTMLAttributes<HTMLElement>, \"title\" | \"children\"> & {\n  title: string;\n  /** The value in words (\"Under $45k\"). Shown on the closed card; null or empty means the filter is unset. */\n  summary?: string | null;\n  /** Clears this one filter. When given, a Clear button takes the summary's place while open or hovered. */\n  onClear?: () => void;\n  /** Controlled open state. Leave undefined to let the card manage it. */\n  open?: boolean;\n  defaultOpen?: boolean;\n  onOpenChange?: (open: boolean) => void;\n  /** Looks like a closed card but cannot be opened or focused, e.g. a filter whose body is not ready. */\n  disabled?: boolean;\n  /** Accessible name of the Clear button. Default \"Clear {title}\". */\n  clearLabel?: string;\n  /** Heading level wrapping the head button. Default 3. */\n  headingLevel?: 2 | 3 | 4 | 5 | 6;\n  bodyClassName?: string;\n  children?: ReactNode;\n};\n\nconst SMOOTH = \"ease-[cubic-bezier(0.22,1,0.36,1)]\";\n\n// The summary and Clear share one slot and trade places over 150ms through a 2px blur and 4px shift.\nconst SUMMARY_HIDDEN = \"opacity-0 blur-[2px] -translate-y-1\";\nconst SUMMARY_HIDES_WHEN = [\n  \"group-data-[state=open]/card:opacity-0 group-data-[state=open]/card:blur-[2px] group-data-[state=open]/card:-translate-y-1\",\n  \"group-hover/slot:opacity-0 group-hover/slot:blur-[2px] group-hover/slot:-translate-y-1\",\n  \"group-focus-within/slot:opacity-0 group-focus-within/slot:blur-[2px] group-focus-within/slot:-translate-y-1\",\n].join(\" \");\n// Hovering anywhere on a closed card offers Clear in the summary's place.\nconst SUMMARY_HIDES_ON_CARD_HOVER = \"group-hover/card:opacity-0 group-hover/card:blur-[2px] group-hover/card:-translate-y-1\";\nconst CLEAR_SHOWS_ON_CARD_HOVER = \"group-hover/card:opacity-100 group-hover/card:blur-none group-hover/card:translate-y-0\";\n// A hidden Clear takes no taps: only a pointer that can hover reveals it before a click.\nconst CLEAR_HIDDEN = \"pointer-events-none opacity-0 blur-[2px] translate-y-1 [@media(hover:hover)]:pointer-events-auto\";\nconst CLEAR_SHOWS_WHEN = [\n  \"group-data-[state=open]/card:pointer-events-auto group-data-[state=open]/card:opacity-100 group-data-[state=open]/card:blur-none group-data-[state=open]/card:translate-y-0\",\n  \"group-hover/slot:opacity-100 group-hover/slot:blur-none group-hover/slot:translate-y-0\",\n  \"group-focus-within/slot:opacity-100 group-focus-within/slot:blur-none group-focus-within/slot:translate-y-0\",\n].join(\" \");\n\nconst FOCUS_RING =\n  \"outline-none focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-[var(--fu-accent-soft,#8FAAFF)]\";\n\n/**\n * One filter in a rounded card: a 52px head (title, value summary or Clear, chevron) that opens a body.\n * Opening animates the height over 480ms and reveals the content from a 6px blur, 6px lower.\n */\nexport function FilterCard({\n  title,\n  summary,\n  onClear,\n  open: openProp,\n  defaultOpen = false,\n  onOpenChange,\n  disabled = false,\n  clearLabel,\n  headingLevel = 3,\n  className,\n  bodyClassName,\n  children,\n  ...props\n}: FilterCardProps) {\n  const id = useId();\n  const headId = `${id}-head`;\n  const bodyId = `${id}-body`;\n  const head = useRef<HTMLButtonElement>(null);\n  const [innerOpen, setInnerOpen] = useState(defaultOpen);\n  const open = !disabled && (openProp ?? innerOpen);\n  const set = Boolean(summary);\n\n  // The last summary stays in place while it fades out after a clear.\n  const [lastSummary, setLastSummary] = useState(summary ?? \"\");\n  if (summary && summary !== lastSummary) setLastSummary(summary);\n\n  const setOpen = (next: boolean) => {\n    if (openProp === undefined) setInnerOpen(next);\n    onOpenChange?.(next);\n  };\n\n  const Heading = `h${headingLevel}` as const;\n  const swap = cn(\n    \"transition-[opacity,filter,translate] duration-150 ease-in-out motion-reduce:transition-none\",\n    \"group-data-[state=open]/card:duration-[480ms] group-data-[state=open]/card:ease-[cubic-bezier(0.22,1,0.36,1)]\",\n  );\n\n  return (\n    <section\n      data-state={open ? \"open\" : \"closed\"}\n      data-set={set ? \"true\" : \"false\"}\n      className={cn(\n        \"not-prose group/card relative overflow-hidden rounded-[24px] border border-[var(--fu-card-border,#2A2A2A)] bg-[var(--fu-card,#1F1F1F)] text-[var(--fu-text,#F8F5F1)]\",\n        \"transition-[background-color,border-color,opacity] duration-200 motion-reduce:transition-none\",\n        \"[@media(hover:hover)]:data-[state=closed]:has-[[data-filter-card-head]:enabled:hover,[data-filter-card-slot]:hover]:border-[var(--fu-line,#404040)] [@media(hover:hover)]:data-[state=closed]:has-[[data-filter-card-head]:enabled:hover,[data-filter-card-slot]:hover]:bg-[var(--fu-card-hover,#262626)]\",\n        // The head button sits flush in a clipped card, so its focus ring is drawn around the card.\n        \"has-[[data-filter-card-head]:focus-visible]:outline-2 has-[[data-filter-card-head]:focus-visible]:outline-offset-2 has-[[data-filter-card-head]:focus-visible]:outline-solid has-[[data-filter-card-head]:focus-visible]:outline-[var(--fu-accent-soft,#8FAAFF)]\",\n        className,\n      )}\n      {...props}\n    >\n      <Heading className=\"m-0 -mb-0.5 text-[15px] font-semibold leading-5 text-[var(--fu-text,#F8F5F1)]\">\n        <button\n          ref={head}\n          type=\"button\"\n          id={headId}\n          data-filter-card-head=\"\"\n          aria-expanded={open}\n          aria-controls={bodyId}\n          disabled={disabled}\n          onClick={() => setOpen(!open)}\n          className={cn(\n            \"flex h-[52px] w-full cursor-pointer items-center gap-3 rounded-[23px] px-4 text-start font-[inherit] text-inherit disabled:cursor-default\",\n            \"outline-none\",\n          )}\n        >\n          <span className=\"min-w-0 truncate\">{title}</span>\n          {set && <span className=\"sr-only\">, {summary}</span>}\n          {set && (\n            <span aria-hidden=\"true\" className=\"invisible min-w-0 max-w-[calc((100%+32px)*0.55)] shrink-0 truncate text-[14px] font-normal\">\n              {summary}\n            </span>\n          )}\n          <ChevronDownIcon\n            size={20}\n            className={cn(\n              \"ms-auto shrink-0 text-[var(--fu-mute,#BDBDBD)] group-has-[[data-filter-card-head]:disabled]/card:opacity-40 transition-[rotate] duration-[480ms] motion-reduce:transition-none\",\n              SMOOTH,\n              \"group-data-[state=open]/card:rotate-180\",\n            )}\n          />\n        </button>\n      </Heading>\n\n      {onClear && (\n        <div\n          inert={!set}\n          data-filter-card-slot=\"\"\n          className=\"group/slot pointer-events-none absolute inset-e-[46px] top-4 grid h-5 max-w-[55%] justify-items-end text-[14px] leading-5 text-[var(--fu-accent-soft,#8FAAFF)]\"\n        >\n          <span aria-hidden=\"true\" className={cn(\"pointer-events-none max-w-full truncate font-normal [grid-area:1/1]\", swap, set ? SUMMARY_HIDES_WHEN : SUMMARY_HIDDEN, set && !disabled && SUMMARY_HIDES_ON_CARD_HOVER)}>\n            {summary || lastSummary}\n          </span>\n          <button\n            type=\"button\"\n            tabIndex={set ? 0 : -1}\n            aria-label={clearLabel ?? `Clear ${title.toLowerCase()}`}\n            onClick={() => {\n              onClear();\n              head.current?.focus();\n            }}\n            className={cn(\n              \"relative -my-0.5 cursor-pointer rounded-[6px] py-0.5 font-medium [grid-area:1/1] before:absolute before:inset-x-0 before:-inset-y-2 before:content-['']\",\n              FOCUS_RING,\n              \"focus-visible:outline-offset-2\",\n              swap,\n              CLEAR_HIDDEN,\n              set && CLEAR_SHOWS_WHEN,\n              set && !disabled && CLEAR_SHOWS_ON_CARD_HOVER,\n            )}\n          >\n            Clear\n          </button>\n        </div>\n      )}\n      {!onClear && set && (\n        <span\n          aria-hidden=\"true\"\n          className={cn(\n            \"pointer-events-none absolute inset-e-[46px] top-4 max-w-[55%] truncate text-[14px] leading-5 text-[var(--fu-accent-soft,#8FAAFF)]\",\n            swap,\n            \"group-data-[state=open]/card:opacity-0\",\n          )}\n        >\n          {summary}\n        </span>\n      )}\n\n      <div\n        id={bodyId}\n        role=\"region\"\n        aria-labelledby={headId}\n        inert={!open}\n        className={cn(\n          \"grid grid-rows-[0fr] transition-[grid-template-rows] duration-[480ms] motion-reduce:transition-none\",\n          SMOOTH,\n          \"group-data-[state=open]/card:grid-rows-[1fr]\",\n        )}\n      >\n        <div className=\"min-h-0 overflow-hidden\">\n          <div\n            className={cn(\n              // pt-0.5 makes up the head's -2px margin, so content starts right under the 52px head.\n              \"px-4 pt-0.5 pb-4\",\n              \"translate-y-1.5 opacity-0 blur-[6px] transition-[opacity,filter,translate] duration-[480ms] motion-reduce:transition-none\",\n              SMOOTH,\n              \"group-data-[state=open]/card:translate-y-0 group-data-[state=open]/card:opacity-100 group-data-[state=open]/card:blur-none\",\n              \"group-data-[state=open]/card:delay-[120ms] group-data-[state=open]/card:duration-[460ms] group-data-[state=open]/card:ease-[cubic-bezier(0.16,1,0.3,1)]\",\n              bodyClassName,\n            )}\n          >\n            {children}\n          </div>\n        </div>\n      </div>\n    </section>\n  );\n}\n"
    },
    {
      "path": "public/filters-ui/search.svg",
      "type": "registry:file",
      "target": "~/public/filters-ui/search.svg",
      "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"128\" height=\"128\" viewBox=\"0 0 128 128\"><image width=\"128\" height=\"128\" href=\"data:image/webp;base64,UklGRgoOAABXRUJQVlA4WAoAAAAQAAAAfwAAfwAAQUxQSAwEAAARoMeA8zm5mk/d3l272ca2bdvGX322WRvPtu23ybNt65Kt3a3tfZdt9jJTd2d+8036Z0RMAJ1bBUB5vS6747WvktsPpA/uXvl74oFbhlchEEIAoPJFL6eEWYSZRYSZRZhl1zs3NSfAOaDO9D+FhSWXLCyp+9sDcKzkpK+FWTRZZOX0OOBUhelbxCJz5pl6gEN5M3aJXX6mNuBM+Rt2iu3M3QWeAJM3iv3NY90A9fitWCL5etwHVLp/v0R1cw8X+i0vluhmpkSv5ENpifYzpSJW5SuJ/NexSDXdwNGTwuoRardfXFxaMyrocECcXFojIu0OiJu/VYpE/e3i6CelIhBfJ64+Zg8/iLPXmHtMvE13sIVR4u/KyqbiuxyS500lxOPiwTCDoeLz6jwz5Tc6JbdbwTzxOt3ABqqk3ZI3jdwmfmc7WEB8v2Pyvonp4jm3h17JNa7Ji3oYLr4frg61D5yTGVqIpb1bqkWTxf1e0MHH/j2pgzJpdi9VUqeX+M9doDIrALJA55MQ/KZCqRBk8qBQg0Mg/TX6SBBv0Tg/DAmNKWFYTopPBoGLyiJ3iSCI1FP4KhA9FH4OxGjK/Z+BuEihMAw8Bbn7JQxym8IPgbhf4fNAPKnwQiAeU7gjEPcrXBMGXqgwKhA3KTQPg5xPuc/LhGEgckdLw9BCAa8FIRvTuCwEnCJFtAqBfAkNbAkA36ZBeDEAMlxnVACOVtHJ2+9fIeniff/uhdJY/wZqlU15t6usEuE2714FadU57FxvUsfzviVhoNVR124wQEh4trPAROMix+4AmbzDrwPVyWZ8i1vzyOrl7NTBGKzge6e+JLsN9vr0PuzQZT4tJcsJl7gHDMUKPZJ/44bQeK9H8gzsEAYf9YhvNkR0WbFDkh5viWZ5JAd7WaIF7JDsbGCJFngkyeqW6OasQ/J1niUam3ZIXi1pCW02OMS3WSJUeccfyVxjiYhuSrsjRaNhCo1+dkf2tzJFhCt3eyNratsiit1+0Nb/K7Na8kvMGFDl3rSdg/fWpvYbtSQBW0RAfOoKG8mbKoEItVNaxbOsEQHU+7GdGiwsyTvaA6CT2xUpSbofrBERUGrwQ4XZk/hsWHj1y9fUA0Cnn8JKsrws7BEBQOXhC95JHuAz4N3JxPThcQKBzvwdLbkyEicDACHevPuoiRPHDO/SqIAIAOjsq2zWSkbmlABARAQAlGsMZiXpEimjD2lN8a/CSqV3/KP2GZ2fAoDprPJ1AAjfq7wWAmpwUOPyINBFCtlGYaAXc/cVhRFVtuWquDfCQDSIc/Q+hfOu3KSqBqTUn7nY3YJCWnvL2e3qgKBQqy1nk2xKoa1XeEaZ28pSeEvOPcjCzMLZdxqDQowKF7yW3Pj3C1fG6dwjVlA4INgJAADQLACdASqAAIAAPmkskUWkIqGXytckQAaEsgBm3Fgkk+h81mxf6b+r7tYY+2l6FvMJ56PmX82v/Wern7JfeA6l79yvYJ8u32b/3L/Zn2qMx32+6IYnCYL55F5h4x3j4fZP975+PHV8+WoZ/KP6l1gPQM/WJbiKjlkZTHnxq/GC9DszEsfaZwHyJ0O1kP76HbMO3lslzs5X9nH5JnzeJfu6QEL6VkV+9aPd+MuDSub9wxmCPxMj5WPqmfctIKMKEoq3V6SeOhBWNhaKwudxOopHCmurMsuS8KghOy2pLr3HgWihKvn1e6CRiR5d/nLed2sblksqa8NUig9UtrxXVG6cwHHqMESDKmES19HNioZ7YlWix2PuySKgoMIvUmICIC+o/tRVG3hifhQOkQTr8OxhkeuUuV230jqukX1yB4vMWEVD2mE9rmSZTeNWvAuDxBxQHTgdij8iL+fnq75lojQf2Wr49O9rNKkoj/sw0VAAAP79bkyP/9QfO//GqloRbF4t89aj2y3/7ya5l17Jc07vytHJor3lzSorrLy4kJU1LUfTuhWPHaMfXW1A7mM1gXxKRfHW5wkCyh4rIokd6uXCAHYcQf4JXDx1V5Ju9Ed2vFQXAphBc5sMZ1Iv0FgvIrPizjQToBrU2pEt/0V///fq3/8k9b/772touBcJV+D/r+BEjlHlKZOf0+6xnkDpS/b8Nf/NBYoYj5wH/9fA+WwRDfp6GG7nG0RmscbBn5C5iDe1i4QiB8MAjq2I8iAK+EQhvf3VPu+XtZUsFUrfJa38w73bb/Vi4OZJrFeUd3cGHdNOw2zVaJ6VqLbWPA84SAjFGBDi35efaTM5bHG9VehO4c7owr1LZoK4gPgfoh10d1T3XooyVMywniEUdPGp04Id+P5GRDxnux+spEWvTk4qix9PQEQ0rNluawc/6Zo3L9xlBlsQH/RGcv4mziOQpMYtuS/T3nWg0YUtTmwIOHU46HoxOkpQOCxyAK8lKuqZr2mfc++C71/CfGrnrbu0RtlSR+csSZwuKXzM59FzHyE+i49Jm01r+yM05D+LK7y9yM22K7mFts5hY65fs8hWr1/aYmcJx88d3Fy1ujC3+GFYw6uNAooIeLiCaT2q93SIC4vZ/5BgdJAUhCqbQAf1iRq3cYW6NstAmRmxjI9b35KoPrj6czegSz788tHvFMfDYDFO2vj+6tcX3C0MwE+/+/hT2+7Nklx9S1gcwFfCZQh0EDfkA9DBLQ4+iani9s8CMBH3nv0XPEcLxDgPCDoD1BlI/KMAPMTlS4X7/4mhH5KRoeEXJqWrnTMRxe2n7L0Ojpzx0O8bvxE8CxtdbbIlrBxgJ3yienxBnF4JqLeId7J2IizWGmPMOcg9D1iPU6vn/XX/CIyGy+rqQh9ofdWT1WL2JE0OKsBVMHsuSRDhavIhLjg7f9bwp6TbDdBeu69wNiH3wp9NRmXnM4iBq7FkGwv0lNGtSyyTndyFN8Up8yJudm79CV3tv7Vv+X/W+4tbk6tVQFIRSJEUn1ywMo8mD01osc9M9DkSKytT5PrL/cQTkvFZmhso9mySMjawaUdP7w161u/XDysHbXvRPkjuEH/X9T4MfWf8x4wugtOexAC2bnBp5Ta4QXeDfEtJphoB13PripKHudPRcIkVri4+bhZiA6Ur8LZZfs4VxDltpWnHohyvoY0LL7JR8VpeNnS+xU+K5sq7JkTn0vXnZrMUWC0Uk8LzKrciYihisZvOKrBl82oYQ+YBzm0UB3aMkX4CmQy7jteprXwlzRl0PeU7CSLEHk/4WeE9Wa349rowxkqB6gUQY8SPuSF9v2C4fiCHq9Mmy6RTsAgVJ+jBAQIQ8dxMpveBdv9R9r8rzSbr4d/405z7yYcISX9uS1/f3/Fzxgw/51Lae+gkxvPAoQcz6/n9mNfpxz/5QmeQ3D46WtMVSs5nOQuRHCfTkxgoRsG1H0w9vZzzo5cLqPNwyV5w8Bf5ES8zBKqqM6w/fjsbvGsckrEDVZ+X2Xng4i32+a4NDXP25tmhxEyPWmOyaF6lfcB9BnwDPFl81RWrEDwrJYW4x32RAbqtRPEL8WVGiH58+NV+V8LM98/2j2aHRcHiOXhLFFYzeu0ef/gei3OuCuAOAJsMmutv4pzsfEdrYmaEUq7glrbVXtXfu/620iSWH6yJdB/PEjR1G4bBk0/0o0jBG5qWUdNIrTsECWFE3anhEsnR7AJ2a4o+tKDKXwU1/5V21cJR8Qfg/rrLt056zXVHdjb3chz2ng2aUyx4o3UJnzz8rii+uGAiVD/McUl3WUd8EZDtsSF8K7am2A2pYMeCT49mLsL5bHuFmLhB2142/NQzuosoo9TWIFMFNzqB5/mILtSnfbwKQLbHyLNB7N6BjgONvUMXb7sor5g2TTTNkPJ6TbiMmwB1RBBuO2rT6aV0luFbAPqRn5SX9lxUQ+WhBWfdxmELDpuU8ns0HDS43eBW5f2N70IKiKPCSfrQfHYD5Ust7iRZzKaYaH3M9SpsmVb6DgBKnB+qlo8PDQNetle2lu5tTIVJp24c6N8qL7tut+kSs+7uqHlZpKfcgsXVcB+u4EhQrHhGbesB59lfuzH/taKWm3YATX89XyAl3zuF6V7hmQQo98Vx49Z3Sts2+tcAhP8B1S/s0POMC8Wfh0Uuyf/K36a7quFB9vIJacpJKX6kg67jDFWlWvKcQ6o0osRw18XfRnH1NG+E4sEBxRM1SL4ABYD7N8jsBkT39h6Ot/N0o8NOZPKBU03d8PJ9TFodusc2M4TJCjjrId9Tti06bPknmweBfkz9+XReYTzDsRHSg99CoK/ynwY2E/m7KBP2wGHLsi/WMP9ggfr1+bnByWb/DziNatbal2FN83EhGEYnzW2GBlV6ml+dzoxatHnctDVCJFGlmBFWYxX5w7ELH+xcLwMPdcmg9D+aPtUnHxLdzJbmPaE1x7N15C1jQtq+B7Q97jkV0C4oy3tc79u+xsGCDTKyQgiznL6GkhenhtcIx1FB4plKly01vny+ARL/ssNTuf6Y0nWrBRHDIdmcSkmq4WNNd8d0ipqw9y1QmLfpT3AxGQV3at8lC0FBptYxZTQnVX1IR9sqoLMDT/SdxPGz/FWCktQDACyLzYfu0LEaSWyv5HwlBs95O1WMMpTRXaPI2KhgiAb5saVYn8wShjekCTsKGLrSJdgsiKv/FvFWiVOa2XhgCk4Z29+4p+Z8NOj5LNtqY6d3VOI4fm96uJ3U9ptyCJZUHm4fdKmwEJ8Q/xdA4VxwK1e6NAczGexSfoho9dMJDfmq5GLBY10legrFhwKrMeBAyL75NEyOWpNtOJ49VxdpeH+D+v4ercRgg0AAAAA=\"/></svg>\n"
    }
  ],
  "meta": {
    "addedIn": "1.0.0",
    "updatedIn": "1.3.1"
  }
}
