{"version":3,"file":"selectionController.js","names":[],"sources":["esm/selectionController.js"],"sourcesContent":["function getSelectLabelText(label) {\n  if (typeof label === \"string\" || typeof label === \"number\") {\n    return String(label);\n  }\n  if (Array.isArray(label)) {\n    return label.map(getSelectLabelText).join(\"\");\n  }\n  if (label && typeof label === \"object\" && \"props\" in label) {\n    return getSelectLabelText(label.props?.children);\n  }\n  return \"\";\n}\nfunction createSelectItemRegistry(onChange) {\n  const items = [];\n  const labelRegistrations = /* @__PURE__ */ new Map();\n  const explicitTextValues = /* @__PURE__ */ new Map();\n  const itemNodes = /* @__PURE__ */ new Map();\n  const listeners = /* @__PURE__ */ new Set();\n  let indexByValue = null;\n  const notify = () => {\n    indexByValue = null;\n    onChange?.();\n    listeners.forEach((listener) => listener());\n  };\n  const getItems = () => items;\n  const getItem = (value) => items.find((item) => item.value === value);\n  const getIndex = (value) => {\n    if (!indexByValue) {\n      indexByValue = /* @__PURE__ */ new Map();\n      items.forEach((item, index) => {\n        if (!indexByValue.has(item.value)) indexByValue.set(item.value, index);\n      });\n    }\n    return indexByValue.get(value) ?? -1;\n  };\n  const getNodes = () => items.map((item) => itemNodes.get(item.id) ?? null);\n  const getRegisteredLabel = (value) => {\n    const registrations = labelRegistrations.get(value);\n    if (!registrations?.size) return void 0;\n    const values = Array.from(registrations.values());\n    return values[values.length - 1];\n  };\n  const applyRegisteredLabel = (value) => {\n    const registeredLabel = getRegisteredLabel(value);\n    let changed = false;\n    for (const item of items) {\n      if (item.value !== value) continue;\n      const nextLabel = registeredLabel?.label;\n      const nextTextValue = explicitTextValues.get(item.id) || registeredLabel?.textValue;\n      if (item.label !== nextLabel || item.textValue !== nextTextValue) {\n        item.label = nextLabel;\n        item.textValue = nextTextValue;\n        changed = true;\n      }\n    }\n    if (changed) notify();\n  };\n  const syncNodeOrder = () => {\n    items.sort((a, b) => {\n      const aNode = itemNodes.get(a.id);\n      const bNode = itemNodes.get(b.id);\n      if (!aNode || !bNode || typeof aNode.compareDocumentPosition !== \"function\") {\n        return 0;\n      }\n      const position = aNode.compareDocumentPosition(bNode);\n      if (position & 4) return -1;\n      if (position & 2) return 1;\n      return 0;\n    });\n  };\n  const registerItem = (item) => {\n    const id = Symbol(item.value);\n    const registeredLabel = getRegisteredLabel(item.value);\n    const registeredItem = {\n      ...item,\n      ...registeredLabel,\n      textValue: item.textValue ?? registeredLabel?.textValue,\n      id\n    };\n    explicitTextValues.set(id, item.textValue);\n    items.push(registeredItem);\n    notify();\n    return {\n      id,\n      update(next) {\n        const index = items.findIndex((current2) => current2.id === id);\n        if (index < 0) return;\n        const current = items[index];\n        if (\"textValue\" in next) {\n          explicitTextValues.set(id, next.textValue);\n        }\n        const nextItem = { ...current, ...next };\n        if (next.value !== void 0 && next.value !== current.value) {\n          const nextLabel = getRegisteredLabel(next.value);\n          nextItem.label = nextLabel?.label;\n        }\n        const explicitTextValue = explicitTextValues.get(id);\n        nextItem.textValue = explicitTextValue || getSelectLabelText(nextItem.label) || (nextItem.label ? nextItem.value : void 0);\n        const changed = Object.entries(next).some(\n          ([key, value]) => current[key] !== value\n        );\n        const textValueChanged = current.textValue !== nextItem.textValue;\n        if (!changed && !textValueChanged) return;\n        items[index] = nextItem;\n        notify();\n      },\n      setNode(node) {\n        if ((itemNodes.get(id) ?? null) === (node ?? null)) return;\n        if (node) {\n          itemNodes.set(id, node);\n          syncNodeOrder();\n        } else {\n          itemNodes.delete(id);\n        }\n        notify();\n      },\n      unregister() {\n        const index = items.findIndex((current) => current.id === id);\n        if (index < 0) return;\n        items.splice(index, 1);\n        explicitTextValues.delete(id);\n        itemNodes.delete(id);\n        notify();\n      }\n    };\n  };\n  const registerLabel = (value, label, textValue) => {\n    const id = Symbol(value);\n    const normalizedTextValue = textValue || getSelectLabelText(label) || value;\n    const registrations = labelRegistrations.get(value) ?? (() => {\n      const next = /* @__PURE__ */ new Map();\n      labelRegistrations.set(value, next);\n      return next;\n    })();\n    registrations.set(id, { label, textValue: normalizedTextValue });\n    applyRegisteredLabel(value);\n    return () => {\n      registrations.delete(id);\n      if (!registrations.size) {\n        labelRegistrations.delete(value);\n      }\n      applyRegisteredLabel(value);\n    };\n  };\n  const firstEnabledIndex = () => items.findIndex((item) => !item.disabled);\n  const nextEnabledIndex = (fromIndex, direction) => {\n    if (!items.length) return -1;\n    if (fromIndex == null || fromIndex < 0 || fromIndex >= items.length) {\n      if (direction === 1) return firstEnabledIndex();\n      for (let index = items.length - 1; index >= 0; index--) {\n        if (!items[index].disabled) return index;\n      }\n      return -1;\n    }\n    for (let offset = 1; offset <= items.length; offset++) {\n      const index = (fromIndex + direction * offset + items.length) % items.length;\n      if (!items[index]?.disabled) return index;\n    }\n    return -1;\n  };\n  const findTypeaheadIndex = (search, fromIndex) => {\n    const normalizedSearch = search.trim().toLocaleLowerCase();\n    if (!normalizedSearch) return -1;\n    const start = fromIndex == null || fromIndex < 0 ? -1 : fromIndex;\n    for (let offset = 1; offset <= items.length; offset++) {\n      const index = (start + offset) % items.length;\n      const item = items[index];\n      const label = item.textValue || getSelectLabelText(item.label) || item.value;\n      if (!item.disabled && label.toLocaleLowerCase().startsWith(normalizedSearch)) {\n        return index;\n      }\n    }\n    return -1;\n  };\n  return {\n    subscribe(listener) {\n      listeners.add(listener);\n      return () => {\n        listeners.delete(listener);\n      };\n    },\n    registerItem,\n    registerLabel,\n    getItems,\n    getItem,\n    getIndex,\n    getNodes,\n    firstEnabledIndex,\n    nextEnabledIndex,\n    findTypeaheadIndex,\n    getDisabledIndices: () => items.flatMap((item, index) => item.disabled ? [index] : []),\n    getTypeaheadLabels: () => items.map((item) => item.textValue || getSelectLabelText(item.label) || item.value)\n  };\n}\nfunction normalizeSelectSelection(mode, value) {\n  if (mode === \"single\") {\n    return typeof value === \"string\" ? value : \"\";\n  }\n  const values = Array.isArray(value) ? value : [];\n  return [...new Set(values)];\n}\nfunction selectedValuesFromSelection(mode, value) {\n  const normalized = normalizeSelectSelection(mode, value);\n  return mode === \"multiple\" ? normalized : normalized ? [normalized] : [];\n}\nfunction createSelectSelectionController({\n  mode: initialMode,\n  value: initialValue,\n  registry\n}) {\n  let mode = initialMode;\n  let value = normalizeSelectSelection(mode, initialValue);\n  let activeIndex = null;\n  const selectedValues = () => selectedValuesFromSelection(mode, value);\n  const setMode = (nextMode) => {\n    if (mode === nextMode) return value;\n    mode = nextMode;\n    value = normalizeSelectSelection(mode, value);\n    return value;\n  };\n  const setValue = (nextValue) => {\n    value = normalizeSelectSelection(mode, nextValue);\n    return value;\n  };\n  const isSelected = (itemValue) => selectedValues().includes(itemValue);\n  const toggle = (itemValue) => {\n    const item = registry.getItem(itemValue);\n    if (!item || item.disabled) return value;\n    if (mode === \"single\") {\n      value = itemValue;\n      return value;\n    }\n    const current = selectedValues();\n    value = current.includes(itemValue) ? current.filter((currentValue) => currentValue !== itemValue) : [...current, itemValue];\n    return value;\n  };\n  const selectionAnchor = () => {\n    const values = selectedValues();\n    for (let index = values.length - 1; index >= 0; index--) {\n      const item = registry.getItem(values[index]);\n      if (item) return item;\n    }\n    const firstEnabledIndex = registry.firstEnabledIndex();\n    return firstEnabledIndex < 0 ? void 0 : registry.getItems()[firstEnabledIndex];\n  };\n  const selectionAnchorIndex = () => {\n    const anchor = selectionAnchor();\n    return anchor ? registry.getIndex(anchor.value) : -1;\n  };\n  const initialActiveIndex = () => {\n    const anchorIndex = selectionAnchorIndex();\n    const anchor = anchorIndex < 0 ? void 0 : registry.getItems()[anchorIndex];\n    return anchor && !anchor.disabled ? anchorIndex : registry.firstEnabledIndex();\n  };\n  const moveActive = (direction) => {\n    const nextIndex = registry.nextEnabledIndex(activeIndex, direction);\n    activeIndex = nextIndex < 0 ? null : nextIndex;\n    return activeIndex == null ? void 0 : registry.getItems()[activeIndex];\n  };\n  return {\n    registry,\n    get mode() {\n      return mode;\n    },\n    get value() {\n      return value;\n    },\n    get activeIndex() {\n      return activeIndex;\n    },\n    get activeItem() {\n      return activeIndex == null ? void 0 : registry.getItems()[activeIndex];\n    },\n    get shouldCloseOnSelect() {\n      return mode === \"single\";\n    },\n    setMode,\n    setValue,\n    isSelected,\n    toggle,\n    selectionAnchor,\n    selectionAnchorIndex,\n    initialActiveIndex,\n    setActiveIndex(index) {\n      activeIndex = index;\n    },\n    moveActive\n  };\n}\nfunction getSelectListboxProps(mode) {\n  return {\n    role: \"listbox\",\n    \"aria-multiselectable\": mode === \"multiple\" ? true : void 0\n  };\n}\nfunction getSelectOptionProps(mode, selected, disabled, platform) {\n  if (platform === \"native\") {\n    return {\n      accessibilityRole: mode === \"multiple\" ? \"checkbox\" : \"button\",\n      accessibilityState: {\n        selected: mode === \"single\" ? selected : void 0,\n        checked: mode === \"multiple\" ? selected : void 0,\n        disabled\n      }\n    };\n  }\n  return {\n    role: \"option\",\n    \"aria-selected\": selected,\n    \"aria-disabled\": disabled || void 0\n  };\n}\nexport {\n  createSelectItemRegistry,\n  createSelectSelectionController,\n  getSelectLabelText,\n  getSelectListboxProps,\n  getSelectOptionProps,\n  normalizeSelectSelection,\n  selectedValuesFromSelection\n};\n//# sourceMappingURL=selectionController.js.map\n"],"mappings":";AAAA,SAAS,mBAAmB,OAAO;CACjC,IAAI,OAAO,UAAU,YAAY,OAAO,UAAU,UAAU;EAC1D,OAAO,OAAO,KAAK;CACrB;CACA,IAAI,MAAM,QAAQ,KAAK,GAAG;EACxB,OAAO,MAAM,IAAI,kBAAkB,CAAC,CAAC,KAAK,EAAE;CAC9C;CACA,IAAI,SAAS,OAAO,UAAU,YAAY,WAAW,OAAO;EAC1D,OAAO,mBAAmB,MAAM,OAAO,QAAQ;CACjD;CACA,OAAO;AACT;AACA,SAAS,yBAAyB,UAAU;CAC1C,MAAM,QAAQ,CAAC;CACf,MAAM,qCAAqC,IAAI,IAAI;CACnD,MAAM,qCAAqC,IAAI,IAAI;CACnD,MAAM,4BAA4B,IAAI,IAAI;CAC1C,MAAM,4BAA4B,IAAI,IAAI;CAC1C,IAAI,eAAe;CACnB,MAAM,eAAe;EACnB,eAAe;EACf,WAAW;EACX,UAAU,SAAS,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