import { r, v as i, j as S, bB as V, aJ as h } from "./index-6wLGsgHc.js";
import { S as v } from "./useBasicWidgetState-DqA4I-I_-Cy-zNgyc.js";
const w = (e, t) => e.getStringValue(t), x = (e) => e.options.length === 0 || i(e.default) ? null : e.options[e.default], U = (e) => e.rawValue ?? null, j = (e, t, l, a) => {
  t.setStringValue(e, l.value, {
    fromUi: l.fromUi
  }, a);
}, y = ({
  disabled: e,
  element: t,
  widgetMgr: l,
  fragmentId: a
}) => {
  const {
    options: s,
    help: n,
    label: u,
    labelVisibility: d,
    placeholder: g,
    acceptNewOptions: m
  } = t, [p, o] = v({
    getStateFromWidgetMgr: w,
    getDefaultStateFromProto: x,
    getCurrStateFromProto: U,
    updateWidgetMgrState: j,
    element: t,
    widgetMgr: l,
    fragmentId: a
  }), f = r.useCallback((c) => {
    o({
      value: c,
      fromUi: !0
    });
  }, [o]), b = i(t.default) && !e;
  return /* @__PURE__ */ S.jsx(V, {
    label: u,
    labelVisibility: h(d?.value),
    options: s,
    disabled: e,
    onChange: f,
    value: p,
    help: n,
    placeholder: g,
    clearable: b,
    acceptNewOptions: m ?? !1
  });
}, P = r.memo(y);
export {
  P as default
};
//# sourceMappingURL=index-BxHa0gYF-DXmunZaI.js.map
