import { X as S, a4 as u, P as f, bI as y, cW as h, d1 as C, Z as l, d2 as p, c3 as v, az as w, N as x, U as V, F as a, bU as $, a6 as n, G as d, a7 as o, a8 as i, Y as g, af as s, bJ as I, a9 as P, aa as D, ac as E, bL as M, av as F, bS as k, d3 as B } from "./603b75d9.js";
import { formDataChildren as N, FormDataPropertyView as R } from "./f9847c56.js";
import { SelectInputValidationChildren as z, useSelectInputValidate as L, SelectInputValidationSection as O, selectDivRefMethods as U, SelectInputInvalidConfig as j } from "./00d44232.js";
import { useContext as r } from "react";
import { fixOldInputCompData as q } from "./41aba172.js";
import "react-dom";
const A = (e) => F`
    &.ant-segmented:not(.ant-segmented-disabled) {
      &,
      .ant-segmented-item-selected,
      .ant-segmented-thumb,
      .ant-segmented-item:hover,
      .ant-segmented-item:focus {
        color: ${e.text};
        border-radius: ${e.radius};
      }
      .ant-segmented-item {
        padding: ${e.padding};
      }
      .ant-segmented-item-selected,
      .ant-segmented-thumb {
        background: ${e.indicatorBackground};
      }
    }

    &.ant-segmented,
    .ant-segmented-item-selected {
      border-radius: ${e.radius};
    }
    &.ant-segmented, .ant-segmented-item-label {
      font-family:${e.fontFamily};
      font-style:${e.fontStyle};
      font-size:${e.textSize};
      font-weight:${e.textWeight};
      text-transform:${e.textTransform};
      text-decoration:${e.textDecoration};
    }
  `, T = S(B)`
  width: 100%;
  min-height: 24px; // keep the height unchanged when there are no options
  ${(e) => e.$style && A(e.$style)}
`, W = {
  defaultValue: u("value"),
  value: u("value"),
  label: f,
  disabled: y,
  onEvent: h,
  options: C,
  style: l(p, "style"),
  labelStyle: l(v, "labelStyle"),
  animationStyle: l(w, "animationStyle"),
  viewRef: x,
  ...z,
  ...N
};
let m = function() {
  return new V(W, (e) => {
    const [c, b] = L(e);
    return e.label({
      required: e.required,
      style: e.style,
      labelStyle: e.labelStyle,
      animationStyle: e.animationStyle,
      children: /* @__PURE__ */ a(T, {
        ref: e.viewRef,
        block: !0,
        disabled: e.disabled,
        value: e.value.value,
        $style: e.style,
        onChange: (t) => {
          b(String(t));
        },
        options: e.options.filter((t) => t.value !== void 0 && !t.hidden).map((t) => ({
          label: t.label,
          value: t.value,
          disabled: t.disabled,
          icon: $(t.prefixIcon) && t.prefixIcon
        }))
      }),
      ...c
    });
  }).setPropertyViewFn((e) => /* @__PURE__ */ n(d, {
    children: [/* @__PURE__ */ n(o, {
      name: i.basic,
      children: [e.options.propertyView({}), e.defaultValue.propertyView({
        label: g("prop.defaultValue")
      })]
    }), ["logic", "both"].includes(r(s).editorModeStatus) && /* @__PURE__ */ n(d, {
      children: [/* @__PURE__ */ a(O, {
        ...e
      }), /* @__PURE__ */ a(R, {
        ...e
      }), /* @__PURE__ */ n(o, {
        name: i.interaction,
        children: [e.onEvent.getPropertyView(), I(e), P(e)]
      })]
    }), ["layout", "both"].includes(r(s).editorModeStatus) && e.label.getPropertyView(), ["layout", "both"].includes(r(s).editorModeStatus) && /* @__PURE__ */ n(d, {
      children: [/* @__PURE__ */ a(o, {
        name: i.style,
        children: e.style.getPropertyView()
      }), /* @__PURE__ */ a(o, {
        name: i.labelStyle,
        children: e.labelStyle.getPropertyView()
      }), /* @__PURE__ */ a(o, {
        name: i.animationStyle,
        hasTooltip: !0,
        children: e.animationStyle.getPropertyView()
      })]
    })]
  })).setExposeMethodConfigs(U).build();
}();
m = k(m, q);
const K = D(m, [new E("value", g("selectInput.valueDesc")), j, ...M]);
export {
  K as SegmentedControlComp
};
