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.CEYoudG7.js";import"./loglevel.H4SN4KQm.js";import"./isLength.Dot76Eow.js";import"./getColors.Llt-1DRT.js";import{Q as r}from"./protobuf.GnXEZo24.js";import{h as i}from"./src.CIyydb94.js";import{N as a}from"./utils.C1Nidt8_.js";import"./utils.VFl7c69J.js";import"./ErrorElement.K-kvHExv.js";import"./v4.C6ecLp5d.js";import"./utils.B6lSy2ZF.js";import"./UriUtil.BJr0dLQG.js";import"./useCopyToClipboard.CUBg6ZxJ.js";import"./useWindowDimensionsContext.jnKliU5K.js";import"./katex.min.DyoqhKgf.js";import"./FormClearHelper.CFhIgu20.js";import{n as o}from"./useBasicWidgetState.DN3lvm1B.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}=t,[b,x]=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}),S=(0,s.useCallback)(e=>{x({value:e,fromUi:!0})},[x]),C=r(t.default)&&!e;return n(i,{label:g,labelVisibility:a(_?.value),options:m,disabled:e,onChange:S,value:b,help:h,placeholder:v,clearable:C,acceptNewOptions:y??!1})});export{f as default};