import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{c as n}from"./emotion-styled.browser.esm.DmHEQgFq.js";import{Q as r}from"./protobuf.Cj15o6C6.js";import{N as i}from"./utils.CmclnrwZ.js";import{Q as a}from"./index.BfkDCGNp.js";import{n as o}from"./useBasicWidgetState.Bj6bxpQq.js";var s=e(t(),1),c=(e,t)=>e.getStringValue(t),l=e=>e.options.length===0||r(e.default)?null:e.options[e.default],u=e=>e.rawValue??null,d=(e,t,n,r)=>{t.setStringValue(e,n.value,{fromUi:n.fromUi},r)},f=(0,s.memo)(({disabled:e,element:t,widgetMgr:f,fragmentId:p})=>{let{options:m,help:h,label:g,labelVisibility:_,placeholder:v,acceptNewOptions:y,filterMode:b}=t,[x,S]=o({getStateFromWidgetMgr:c,getDefaultStateFromProto:l,getCurrStateFromProto:u,updateWidgetMgrState:d,element:t,widgetMgr:f,fragmentId:p,formClearBehavior:`resetValueOnly`,queryParamBinding:t.queryParamKey?{paramKey:t.queryParamKey,valueType:`string_value`,clearable:r(t.default)}:void 0}),C=(0,s.useCallback)(e=>{S({value:e,fromUi:!0})},[S]),w=r(t.default)&&!e;return n(a,{label:g,labelVisibility:i(_?.value),options:m,disabled:e,onChange:C,value:x,help:h,placeholder:v,clearable:w,acceptNewOptions:y??!1,filterMode:b})});export{f as default};