{"version":3,"file":"Select.js","names":[],"sources":["jsx/Select.js"],"sourcesContent":["import { Adapt, AdaptParent, useAdaptIsActive } from \"@tamagui/adapt\";\nimport { useComposedRefs } from \"@tamagui/compose-refs\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { Text, View, createChangeEventDetails, createStyledContext, createStyledHOC, styled } from \"@tamagui/core\";\nimport { FocusScopeController } from \"@tamagui/focus-scope\";\nimport { withStaticProperties } from \"@tamagui/helpers\";\nimport { useControllableState } from \"@tamagui/use-controllable-state\";\nimport * as React from \"react\";\nimport { SelectItemParentProvider, SelectNativeComponentContext, SelectProvider, SelectZIndexContext, useSelectContext, useSelectItemParentContext } from \"./context\";\nimport { SelectContent } from \"./SelectContent\";\nimport { SelectInlineImpl } from \"./SelectImpl\";\nimport { SelectItem, useSelectItemContext } from \"./SelectItem\";\nimport { SelectItemText } from \"./SelectItemText\";\nimport { SelectScrollDownButton, SelectScrollUpButton } from \"./SelectScrollButton\";\nimport { SelectTrigger } from \"./SelectTrigger\";\nimport { SelectViewport } from \"./SelectViewport\";\nimport { createSelectItemRegistry, createSelectSelectionController, selectedValuesFromSelection } from \"./selectionController\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\n\nconst SelectValueFrame = styled(Text, { displayName: \"SelectValue\" });\nconst SelectValue = createStyledHOC(SelectValueFrame, function SelectValue2(propsIn, forwardedRef) {\n\tconst { scope, children: childrenProp, placeholder, ...props } = propsIn;\n\tconst context = useSelectContext(scope);\n\tconst itemParentContext = useSelectItemParentContext(scope);\n\tconst composedRefs = useComposedRefs(forwardedRef, context.onValueNodeChange);\n\tconst isEmptyValue = context.selectedValues.length === 0;\n\tconst [, rerender] = React.useReducer((version) => version + 1, 0);\n\tuseIsomorphicLayoutEffect(() => itemParentContext.registry.subscribe(rerender), [itemParentContext.registry]);\n\tconst registeredValue = context.mode === \"multiple\" ? context.selectedValues.map((value, index) => /* @__PURE__ */ jsxs(React.Fragment, { children: [index > 0 ? \", \" : null, itemParentContext.registry.getItem(value)?.label ?? value] }, value)) : itemParentContext.registry.getItem(context.selectedValues[0])?.label ?? context.value;\n\tconst children = childrenProp !== void 0 ? childrenProp : context.renderValue ? context.renderValue(context.value) : registeredValue;\n\tconst selectValueChildren = isEmptyValue ? placeholder ?? children : children;\n\treturn /* @__PURE__ */ jsx(SelectValueFrame, {\n\t\tpointerEvents: \"none\",\n\t\tref: composedRefs,\n\t\t...props,\n\t\tchildren: selectValueChildren\n\t});\n});\nconst SelectIcon = styled(View, {\n\tdisplayName: \"SelectIcon\",\n\t\"aria-hidden\": true\n});\nconst SelectItemIndicatorFrame = styled(View, { displayName: \"SelectItemIndicator\" });\nconst SelectItemIndicator = createStyledHOC(SelectItemIndicatorFrame, function SelectItemIndicator2(props, forwardedRef) {\n\tconst { scope, ...itemIndicatorProps } = props;\n\tconst context = useSelectItemParentContext(scope);\n\tconst itemContext = useSelectItemContext(scope);\n\tif (context.shouldRenderWebNative) return null;\n\treturn itemContext.isSelected ? /* @__PURE__ */ jsx(SelectItemIndicatorFrame, {\n\t\t\"aria-hidden\": true,\n\t\t...itemIndicatorProps,\n\t\tref: forwardedRef\n\t}) : null;\n});\nconst SelectIndicatorFrame = styled(View, {\n\tdisplayName: \"SelectIndicator\",\n\tposition: \"absolute\",\n\ttop: 0,\n\tleft: 0,\n\tpointerEvents: \"none\",\n\tzIndex: 10\n});\nconst SelectIndicator = createStyledHOC(SelectIndicatorFrame, function SelectIndicator2(propsIn, forwardedRef) {\n\tconst { scope, ...props } = propsIn;\n\tconst itemContext = useSelectItemParentContext(scope);\n\tconst context = useSelectContext(scope);\n\tconst [layout, setLayout] = React.useState(null);\n\tconst rafRef = React.useRef(0);\n\tuseIsomorphicLayoutEffect(() => {\n\t\tconst update = (index) => {\n\t\t\tif (typeof index !== \"number\") return;\n\t\t\tcancelAnimationFrame(rafRef.current);\n\t\t\trafRef.current = requestAnimationFrame(() => {\n\t\t\t\tconst node = itemContext.listRef?.current?.[index];\n\t\t\t\tif (node) setLayout({\n\t\t\t\t\twidth: Math.round(node.offsetWidth),\n\t\t\t\t\theight: Math.round(node.offsetHeight),\n\t\t\t\t\tx: Math.round(node.offsetLeft),\n\t\t\t\t\ty: Math.round(node.offsetTop)\n\t\t\t\t});\n\t\t\t});\n\t\t};\n\t\tif (context.open && context.activeIndexRef.current !== null) update(context.activeIndexRef.current);\n\t\treturn itemContext.activeIndexSubscribe(update);\n\t}, [context.open, itemContext.listRef]);\n\tif (!layout) return null;\n\treturn /* @__PURE__ */ jsx(SelectIndicatorFrame, {\n\t\tref: forwardedRef,\n\t\t...props,\n\t\twidth: layout.width,\n\t\theight: layout.height,\n\t\tx: layout.x,\n\t\ty: layout.y\n\t});\n});\nconst GROUP_NAME = \"SelectGroup\";\nconst { Provider: SelectGroupContextProvider, useStyledContext: useSelectGroupContext } = createStyledContext({ id: \"\" }, \"SelectGroup\");\nconst SelectGroupFrame = styled(View, { displayName: GROUP_NAME });\nconst NativeSelect = styled(Text, {\n\tdisplayName: \"NativeSelect\",\n\trender: \"select\"\n});\nconst SelectGroup = createStyledHOC(SelectGroupFrame, (propsIn, forwardedRef) => {\n\tconst props = propsIn;\n\tconst { scope, ...groupProps } = props;\n\tconst groupId = React.useId();\n\tconst context = useSelectContext(scope);\n\tconst itemParentContext = useSelectItemParentContext(scope);\n\tconst StyledNativeSelect = React.useContext(SelectNativeComponentContext);\n\tconst nativeSelectRef = React.useRef(null);\n\tconst content = (() => {\n\t\tif (itemParentContext.shouldRenderWebNative) return /* @__PURE__ */ jsx(NativeSelect, {\n\t\t\t...StyledNativeSelect && {\n\t\t\t\trender: StyledNativeSelect,\n\t\t\t\tsize: itemParentContext.size,\n\t\t\t\tstyle: { appearance: \"none\" }\n\t\t\t},\n\t\t\t...groupProps,\n\t\t\tvalue: context.value,\n\t\t\tmultiple: context.mode === \"multiple\",\n\t\t\tname: itemParentContext.name,\n\t\t\tform: itemParentContext.form,\n\t\t\tid: itemParentContext.id,\n\t\t\tonChange: ((event) => {\n\t\t\t\tconst value = context.mode === \"multiple\" ? Array.from(event.currentTarget.selectedOptions, (option) => option.value) : event.currentTarget.value;\n\t\t\t\titemParentContext.changeNativeValue(value, event.nativeEvent);\n\t\t\t}),\n\t\t\tref: nativeSelectRef,\n\t\t\tchildren: props.children\n\t\t});\n\t\treturn /* @__PURE__ */ jsx(SelectGroupFrame, {\n\t\t\trole: \"group\",\n\t\t\t\"aria-labelledby\": groupId,\n\t\t\t...groupProps,\n\t\t\tref: forwardedRef\n\t\t});\n\t})();\n\treturn /* @__PURE__ */ jsx(SelectGroupContextProvider, {\n\t\tscope,\n\t\tid: groupId || \"\",\n\t\tchildren: content\n\t});\n});\nSelectGroup.displayName = GROUP_NAME;\nconst SelectLabelFrame = styled(Text, { displayName: \"SelectLabel\" });\nconst SelectLabel = createStyledHOC(SelectLabelFrame, (propsIn, forwardedRef) => {\n\tconst { scope, ...labelProps } = propsIn;\n\tconst context = useSelectItemParentContext(scope);\n\tconst groupContext = useSelectGroupContext(scope);\n\tif (context.shouldRenderWebNative) return null;\n\treturn /* @__PURE__ */ jsx(SelectLabelFrame, {\n\t\trender: \"div\",\n\t\tid: groupContext.id,\n\t\t...labelProps,\n\t\tref: forwardedRef\n\t});\n});\nconst SelectSeparator = styled(View, { displayName: \"SelectSeparator\" });\nconst SelectSheetImpl = (props) => {\n\treturn /* @__PURE__ */ jsx(Fragment, { children: props.children });\n};\nfunction SelectRoot(props) {\n\tconst adaptScope = `AdaptSelect${props.scope || \"\"}`;\n\tconst [open, requestOpenChange] = useControllableState({\n\t\tprop: props.open,\n\t\tdefaultProp: props.defaultOpen || false,\n\t\tonChange: props.onOpenChange\n\t});\n\tconst handleAdaptOpenChange = React.useCallback((nextOpen) => {\n\t\trequestOpenChange(nextOpen, createChangeEventDetails(nextOpen ? \"trigger-press\" : \"outside-press\"));\n\t}, [requestOpenChange]);\n\treturn /* @__PURE__ */ jsx(AdaptParent, {\n\t\tscope: adaptScope,\n\t\tadaptChildren: props.children,\n\t\topen,\n\t\tonOpenChange: handleAdaptOpenChange,\n\t\tchildren: /* @__PURE__ */ jsx(SelectInner, {\n\t\t\t...props,\n\t\t\tscope: props.scope,\n\t\t\tadaptScope,\n\t\t\topen,\n\t\t\trequestOpenChange\n\t\t})\n\t});\n}\nconst Select = withStaticProperties(SelectRoot, {\n\tRoot: SelectRoot,\n\tAdapt,\n\tContent: SelectContent,\n\tGroup: SelectGroup,\n\tIcon: SelectIcon,\n\tItem: SelectItem,\n\tItemIndicator: SelectItemIndicator,\n\tItemText: SelectItemText,\n\tLabel: SelectLabel,\n\tScrollDownButton: SelectScrollDownButton,\n\tScrollUpButton: SelectScrollUpButton,\n\tSeparator: SelectSeparator,\n\tTrigger: SelectTrigger,\n\tValue: SelectValue,\n\tViewport: SelectViewport,\n\tIndicator: SelectIndicator,\n\tFocusScope: FocusScopeController\n});\nfunction useEmitter() {\n\tconst listenersRef = React.useRef(/* @__PURE__ */ new Set());\n\treturn [React.useCallback((value) => {\n\t\tlistenersRef.current.forEach((l) => l(value));\n\t}, []), React.useCallback((listener) => {\n\t\tlistenersRef.current.add(listener);\n\t\treturn () => {\n\t\t\tlistenersRef.current.delete(listener);\n\t\t};\n\t}, [])];\n}\nfunction SelectInner(props) {\n\tconst { scope = \"\", adaptScope, native, children, open, requestOpenChange, defaultOpen: _defaultOpen, onOpenChange: _onOpenChange, value: valueProp, defaultValue, onValueChange, multiple = false, name, form, disablePreventBodyScroll, size: sizeProp = true, onActiveChange, dir, id, renderValue, lazyMount, zIndex } = props;\n\tconst SelectImpl = useAdaptIsActive(adaptScope) ? SelectSheetImpl : SelectInlineImpl;\n\tconst mode = multiple ? \"multiple\" : \"single\";\n\tconst [valueState, requestValueChange] = useControllableState({\n\t\tprop: valueProp,\n\t\tdefaultProp: defaultValue ?? (mode === \"multiple\" ? [] : \"\"),\n\t\tonChange: onValueChange,\n\t\ttransition: true\n\t});\n\tconst value = React.useMemo(() => mode === \"multiple\" ? selectedValuesFromSelection(mode, valueState) : typeof valueState === \"string\" ? valueState : \"\", [mode, valueState]);\n\tconst selectedValues = React.useMemo(() => selectedValuesFromSelection(mode, value), [mode, value]);\n\tconst [, rerenderRegistry] = React.useReducer((version) => version + 1, 0);\n\tconst registryRef = React.useRef(null);\n\tif (!registryRef.current) registryRef.current = createSelectItemRegistry(rerenderRegistry);\n\tconst registry = registryRef.current;\n\tconst controllerRef = React.useRef(null);\n\tif (!controllerRef.current) controllerRef.current = createSelectSelectionController({\n\t\tmode,\n\t\tvalue,\n\t\tregistry\n\t});\n\tconst controller = controllerRef.current;\n\tcontroller.setMode(mode);\n\tcontroller.setValue(value);\n\tReact.useEffect(() => {}, [props.id, requestOpenChange]);\n\tconst activeIndexRef = React.useRef(null);\n\tconst [emitActiveIndex, activeIndexSubscribe] = useEmitter();\n\tconst selectedIndexRef = React.useRef(null);\n\tconst lastPointerRef = React.useRef({\n\t\tx: -1,\n\t\ty: -1\n\t});\n\tconst listContentRef = React.useRef([]);\n\tconst listRef = React.useRef([]);\n\tconst [valueNode, setValueNode] = React.useState(null);\n\tconst selectedIndex = Math.max(0, controller.selectionAnchorIndex());\n\tlistContentRef.current = registry.getTypeaheadLabels();\n\tconst itemNodes = registry.getNodes();\n\tlistRef.current.length = itemNodes.length;\n\tfor (let i = 0; i < itemNodes.length; i++) listRef.current[i] = itemNodes[i];\n\tuseIsomorphicLayoutEffect(() => {\n\t\tselectedIndexRef.current = selectedIndex;\n\t});\n\tconst shouldRenderWebNative = isWeb && (native === true || native === \"web\" || Array.isArray(native) && native.includes(\"web\"));\n\tconst setActiveIndex = React.useCallback((index, details) => {\n\t\tif (activeIndexRef.current === index) return;\n\t\tactiveIndexRef.current = index;\n\t\tcontroller.setActiveIndex(index);\n\t\temitActiveIndex(index);\n\t\tif (typeof index === \"number\") {\n\t\t\tconst item = registry.getItems()[index];\n\t\t\tif (item && details) onActiveChange?.(item.value, details);\n\t\t}\n\t}, [\n\t\tcontroller,\n\t\temitActiveIndex,\n\t\tonActiveChange,\n\t\tregistry\n\t]);\n\tconst activeDetails = React.useCallback((reason, index, event) => ({\n\t\treason,\n\t\tevent,\n\t\ttrigger: void 0,\n\t\tindex\n\t}), []);\n\tconst moveActive = React.useCallback((direction, event) => {\n\t\tconst nextIndex = registry.nextEnabledIndex(activeIndexRef.current, direction);\n\t\tif (nextIndex >= 0) setActiveIndex(nextIndex, activeDetails(\"keyboard\", nextIndex, event));\n\t}, [\n\t\tactiveDetails,\n\t\tregistry,\n\t\tsetActiveIndex\n\t]);\n\tconst typeaheadRef = React.useRef({\n\t\ttext: \"\",\n\t\ttimeout: null\n\t});\n\tconst search = React.useCallback((text, event) => {\n\t\tclearTimeout(typeaheadRef.current.timeout);\n\t\ttypeaheadRef.current.text += text;\n\t\tlet nextIndex = registry.findTypeaheadIndex(typeaheadRef.current.text, activeIndexRef.current);\n\t\tif (nextIndex < 0 && typeaheadRef.current.text.length > 1) {\n\t\t\ttypeaheadRef.current.text = text;\n\t\t\tnextIndex = registry.findTypeaheadIndex(text, activeIndexRef.current);\n\t\t}\n\t\ttypeaheadRef.current.timeout = setTimeout(() => {\n\t\t\ttypeaheadRef.current.text = \"\";\n\t\t}, 750);\n\t\tif (nextIndex >= 0) setActiveIndex(nextIndex, activeDetails(\"keyboard\", nextIndex, event));\n\t}, [\n\t\tactiveDetails,\n\t\tregistry,\n\t\tsetActiveIndex\n\t]);\n\tReact.useEffect(() => {\n\t\treturn () => clearTimeout(typeaheadRef.current.timeout);\n\t}, []);\n\tReact.useEffect(() => {\n\t\tif (open) {\n\t\t\tconst nextIndex = controller.initialActiveIndex();\n\t\t\tif (nextIndex >= 0) setActiveIndex(nextIndex, activeDetails(\"list-navigation\", nextIndex));\n\t\t} else setActiveIndex(null);\n\t}, [\n\t\topen,\n\t\tselectedIndex,\n\t\tregistry.getItems().length\n\t]);\n\tconst content = /* @__PURE__ */ jsxs(SelectItemParentProvider, {\n\t\tscopeName: scope,\n\t\tscope,\n\t\tadaptScope,\n\t\tmode,\n\t\tselectedValues,\n\t\tregistry,\n\t\tsize: sizeProp,\n\t\tactiveIndexSubscribe,\n\t\tactiveIndexRef,\n\t\trequestOpenChange,\n\t\tid,\n\t\tname,\n\t\tform,\n\t\tselectValue: React.useCallback((nextItemValue, details) => {\n\t\t\tconst item = registry.getItem(nextItemValue);\n\t\t\tif (!item || item.disabled) return;\n\t\t\tcontroller.setMode(mode);\n\t\t\tcontroller.setValue(value);\n\t\t\tconst previousValue = controller.value;\n\t\t\trequestValueChange(controller.toggle(nextItemValue), details);\n\t\t\tif (details.isCanceled) {\n\t\t\t\tcontroller.setValue(previousValue);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (controller.shouldCloseOnSelect) requestOpenChange(false, createChangeEventDetails(details.reason === \"keyboard\" ? \"keyboard\" : \"item-press\", details.event, details.trigger));\n\t\t}, [\n\t\t\tcontroller,\n\t\t\tmode,\n\t\t\tregistry,\n\t\t\trequestOpenChange,\n\t\t\trequestValueChange,\n\t\t\tvalue\n\t\t]),\n\t\tchangeNativeValue: React.useCallback((nextValue, event) => {\n\t\t\tconst details = createChangeEventDetails(\"native-change\", event);\n\t\t\trequestValueChange(nextValue, details);\n\t\t\tif (!details.isCanceled) controller.setValue(nextValue);\n\t\t}, [controller, requestValueChange]),\n\t\tshouldRenderWebNative,\n\t\tsetActiveIndex,\n\t\tselectedIndex,\n\t\tlastPointerRef,\n\t\tlistRef,\n\t\tmoveActive,\n\t\tsearch,\n\t\tchildren: [/* @__PURE__ */ jsx(SelectProvider, {\n\t\t\tscope,\n\t\t\tscopeName: scope,\n\t\t\tadaptScope,\n\t\t\tdisablePreventBodyScroll,\n\t\t\tdir,\n\t\t\tblockSelection: false,\n\t\t\tfallback: false,\n\t\t\tvalueNode,\n\t\t\tonValueNodeChange: setValueNode,\n\t\t\tactiveIndexRef,\n\t\t\tselectedIndex,\n\t\t\tsetActiveIndex,\n\t\t\tvalue,\n\t\t\tmode,\n\t\t\tselectedValues,\n\t\t\topen,\n\t\t\tnative,\n\t\t\trenderValue,\n\t\t\tlazyMount,\n\t\t\tchildren: shouldRenderWebNative ? children : /* @__PURE__ */ jsx(SelectImpl, {\n\t\t\t\tactiveIndexRef,\n\t\t\t\tlistContentRef,\n\t\t\t\tselectedIndexRef,\n\t\t\t\t...props,\n\t\t\t\topen,\n\t\t\t\tvalue,\n\t\t\t\tchildren\n\t\t\t})\n\t\t}), isWeb && !shouldRenderWebNative && name ? (mode === \"multiple\" ? selectedValues : [value]).map((inputValue) => /* @__PURE__ */ jsx(\"input\", {\n\t\t\ttype: \"hidden\",\n\t\t\tname,\n\t\t\tform,\n\t\t\tvalue: inputValue\n\t\t}, inputValue)) : null]\n\t});\n\tif (zIndex !== void 0) return /* @__PURE__ */ jsx(SelectZIndexContext.Provider, {\n\t\tvalue: zIndex,\n\t\tchildren: content\n\t});\n\treturn content;\n}\n\nexport { Select, SelectGroup, SelectGroupFrame, SelectIcon, SelectIndicator, SelectIndicatorFrame, SelectItemIndicator, SelectItemIndicatorFrame, SelectLabel, SelectLabelFrame, SelectRoot, SelectSeparator, SelectValue, SelectValueFrame };"],"mappings":";;;;;;;;;;;;;;;;;;;;AAmBA,MAAM,mBAAmB,OAAO,MAAM,EAAE,aAAa,cAAc,CAAC;AACpE,MAAM,cAAc,gBAAgB,kBAAkB,SAAS,aAAa,SAAS,cAAc;CAClG,MAAM,EAAE,OAAO,UAAU,cAAc,aAAa,GAAG,UAAU;CACjE,MAAM,UAAU,iBAAiB,KAAK;CACtC,MAAM,oBAAoB,2BAA2B,KAAK;CAC1D,MAAM,eAAe,gBAAgB,cAAc,QAAQ,iBAAiB;CAC5E,MAAM,eAAe,QAAQ,eAAe,WAAW;CACvD,MAAM,GAAG,YAAY,MAAM,YAAY,YAAY,UAAU,GAAG,CAAC;CACjE,gCAAgC,kBAAkB,SAAS,UAAU,QAAQ,GAAG,CAAC,kBAAkB,QAAQ,CAAC;CAC5G,MAAM,kBAAkB,QAAQ,SAAS,aAAa,QAAQ,eAAe,KA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