import{r as o,F as i,j as h,cM as w,c0 as M}from"./index-DCNLpqIv.js";import{a as S}from"./useBasicWidgetState-9vtYd9vP.js";import"./FormClearHelper-fvwQICEk.js";const V=(e,t)=>e.getStringValue(t),v=e=>e.options.length===0||i(e.default)?null:e.options[e.default],F=e=>e.rawValue??null,U=(e,t,a,l)=>{t.setStringValue(e,a.value,{fromUi:a.fromUi},l)},j=({disabled:e,element:t,widgetMgr:a,fragmentId:l})=>{const{options:s,help:n,label:g,labelVisibility:u,placeholder:d,acceptNewOptions:m}=t,[p,r]=S({getStateFromWidgetMgr:V,getDefaultStateFromProto:v,getCurrStateFromProto:F,updateWidgetMgrState:U,element:t,widgetMgr:a,fragmentId:l}),c=o.useCallback(b=>{r({value:b,fromUi:!0})},[r]),f=i(t.default)&&!e;return h.jsx(w,{label:g,labelVisibility:M(u?.value),options:s,disabled:e,onChange:c,value:p,help:n,placeholder:d,clearable:f,acceptNewOptions:m??!1})},x=o.memo(j);export{x as default};
