import { defineComponent as d, ref as r, openBlock as t, createElementBlock as s, Fragment as p, createTextVNode as f, toDisplayString as u, createBlock as a, unref as l, withCtx as y, createElementVNode as i } from "vue";
import { EyeOutlined as c, EyeInvisibleOutlined as m } from "@ant-design/icons-vue";
import { Space as v } from "@aplus-frontend/antdv";
const k = /* @__PURE__ */ d({
  name: "ApFieldTextPasswordRead",
  __name: "read-password",
  props: {
    mode: { default: "edit" },
    class: {},
    style: {},
    emptyText: { default: "--" },
    customReadMode: {},
    variant: {},
    size: {},
    value: {},
    name: {},
    type: { default: "text" },
    onCompositionend: {},
    onCompositionstart: {},
    onFocus: {},
    onBlur: {},
    onChange: {},
    onInput: {},
    onKeydown: {},
    onKeyup: {},
    onMousedown: {},
    focused: { type: Boolean },
    hidden: { type: Boolean },
    disabled: { type: Boolean, default: void 0 },
    prefixCls: {},
    id: {},
    readonly: { type: Boolean },
    autofocus: { type: Boolean },
    autocomplete: {},
    placeholder: {},
    lazy: { type: Boolean, default: !0 },
    maxlength: {},
    loading: { type: Boolean },
    bordered: { type: Boolean, default: !0 },
    showCount: { type: [Boolean, Object] },
    htmlSize: {},
    onPressEnter: {},
    onMouseUp: {},
    onRawInput: {},
    "onUpdate:value": {},
    valueModifiers: {},
    status: {},
    defaultValue: {},
    inputElement: {},
    triggerFocus: {},
    handleReset: {},
    addonBefore: {},
    addonAfter: {},
    prefix: {},
    suffix: {},
    clearIcon: {},
    allowClear: { type: Boolean, default: !0 },
    inputPrefixCls: {},
    action: { default: "click" },
    visibilityToggle: { type: Boolean, default: !0 },
    visible: { type: Boolean, default: void 0 },
    "onUpdate:visible": {}
  },
  setup(e) {
    const o = r(e.visible);
    return (x, n) => e.value ? (t(), a(l(v), { key: 1 }, {
      default: y(() => [
        i("span", null, u(o.value ? e.value : "********"), 1),
        i("span", {
          style: { cursor: "pointer" },
          onClick: n[0] || (n[0] = () => o.value = !o.value)
        }, [
          o.value ? (t(), a(l(c), { key: 0 })) : (t(), a(l(m), { key: 1 }))
        ])
      ]),
      _: 1
    })) : (t(), s(p, { key: 0 }, [
      f(u(e.emptyText), 1)
    ], 64));
  }
});
export {
  k as default
};
