import { defineComponent as C, useSlots as b, shallowRef as g, computed as s, unref as t, openBlock as u, createElementBlock as k, Fragment as F, createTextVNode as S, toDisplayString as h, createBlock as P, mergeProps as R, createSlots as T, renderList as V, withCtx as _, renderSlot as N, normalizeProps as U, guardReactiveProps as A } from "vue";
import { Slider as H } from "@aplus-frontend/antdv";
import { omit as L, isNil as $, isArray as w } from "lodash-unified";
import "../../hooks/index.mjs";
import { useControllableValue as j } from "../../hooks/useControllableValue.mjs";
const G = /* @__PURE__ */ C({
  name: "ApFieldSlider",
  __name: "index",
  props: {
    mode: {},
    class: {},
    style: {},
    emptyText: { default: "--" },
    customReadMode: {},
    range: { type: [Boolean, Object] },
    value: {},
    defaultValue: {},
    onChange: {},
    "onUpdate:value": {},
    onAfterChange: {},
    onChangeComplete: {},
    handleStyle: {},
    trackStyle: {},
    prefixCls: {},
    reverse: { type: Boolean },
    min: { default: 0 },
    max: { default: 100 },
    step: { default: 1 },
    marks: {},
    dots: { type: Boolean },
    included: { type: Boolean, default: !0 },
    disabled: { type: Boolean, default: void 0 },
    keyboard: { type: Boolean },
    vertical: { type: Boolean },
    className: {},
    rootClassName: {},
    id: {},
    tooltip: {},
    autoFocus: { type: Boolean },
    styles: {},
    classNames: {},
    onFocus: {},
    onBlur: {},
    tooltipPrefixCls: {},
    tipFormatter: {},
    tooltipVisible: { type: Boolean, default: void 0 },
    getTooltipPopupContainer: {},
    tooltipPlacement: {},
    tabIndex: {},
    ariaLabelForHandle: {},
    ariaLabelledByForHandle: {},
    ariaRequired: { type: Boolean },
    ariaValueTextFormatterForHandle: {}
  },
  emits: ["update:value"],
  setup(l, { expose: i, emit: d }) {
    const p = b(), o = g(), a = l, m = s(
      () => L(a, [
        "value",
        "onUpdate:value",
        "mode",
        "emptyText",
        "defaultValue"
      ])
    ), c = d, { value: r, updateValue: f } = j(a, c), y = s(() => {
      const e = t(r);
      return $(e) ? a.emptyText : w(e) ? `${e[0]}-${e[1]}` : e;
    });
    function v() {
      o.value?.focus?.();
    }
    function B() {
      o.value?.blur?.();
    }
    return i({
      focus: v,
      blur: B
    }), (e, q) => l.mode === "read" ? (u(), k(F, { key: 0 }, [
      S(h(y.value), 1)
    ], 64)) : (u(), P(t(H), R({ key: 1 }, m.value, {
      ref_key: "sliderRef",
      ref: o,
      value: t(r),
      "onUpdate:value": t(f)
    }), T({ _: 2 }, [
      V(p, (z, n) => ({
        name: n,
        fn: _((x) => [
          N(e.$slots, n, U(A(x || {})))
        ])
      }))
    ]), 1040, ["value", "onUpdate:value"]));
  }
});
export {
  G as default
};
