import{o as e}from"./chunk.DuxOD-Sk.js";import{r as t}from"./emotion-is-prop-valid.esm.DV_OErv-.js";import{c as n}from"./emotion-styled.browser.esm.BPUx6WuE.js";import{Q as r}from"./protobuf.DyZGXwGk.js";import{h as i}from"./src.sR_9Xh2m.js";import{N as a}from"./utils.B9mvrYZE.js";import{n as o}from"./useBasicWidgetState.DAZ7WsXN.js";var s=e(t()),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(i,{label:g,labelVisibility:a(_?.value),options:m,disabled:e,onChange:C,value:x,help:h,placeholder:v,clearable:w,acceptNewOptions:y??!1,filterMode:b})});export{f as default};