const e=require("../_util/classNames.js"),t=require("../_util/omit.js"),n=require("../_util/props-util/index.js"),r=require("../config-provider/hooks/useConfigInject.js"),i=require("../_util/vnode.js"),a=require("./inputProps.js"),o=require("./Input.js");let s=require("vue"),c=require("@antsoo-lib/icons");var l={click:`onClick`,hover:`onMouseover`},u=e=>e?(0,s.createVNode)(c.EyeOutlined,null,null):(0,s.createVNode)(c.EyeInvisibleOutlined,null,null),d=(0,s.defineComponent)({compatConfig:{MODE:3},name:`AInputPassword`,inheritAttrs:!1,props:{...a.default(),prefixCls:String,inputPrefixCls:String,action:{type:String,default:`click`},visibilityToggle:{type:Boolean,default:!0},visible:{type:Boolean,default:void 0},"onUpdate:visible":Function,iconRender:Function},setup(a,{slots:c,attrs:d,expose:f,emit:p}){let m=(0,s.shallowRef)(!1),h=()=>{let{disabled:e}=a;e||(m.value=!m.value,p(`update:visible`,m.value))};(0,s.watchEffect)(()=>{a.visible!==void 0&&(m.value=!!a.visible)});let g=(0,s.shallowRef)();f({focus:()=>{g.value?.focus()},blur:()=>{g.value?.blur()}});let _=e=>{let{action:t,iconRender:r=c.iconRender||u}=a,o=l[t]||``,d=r(m.value),f={[o]:h,class:`${e}-icon`,key:`passwordIcon`,onMousedown:e=>{e.preventDefault()},onMouseup:e=>{e.preventDefault()}};return i.cloneElement(n.isValidElement(d)?d:(0,s.createVNode)(`span`,null,[d]),f)},{prefixCls:v,getPrefixCls:y}=r.default(`input-password`,a),b=(0,s.computed)(()=>y(`input`,a.inputPrefixCls)),x=()=>{let{size:n,visibilityToggle:r,...i}=a,l=r&&_(v.value),u=e.default(v.value,d.class,{[`${v.value}-${n}`]:!!n}),f={...t.default(i,[`suffix`,`iconRender`,`action`]),...d,type:m.value?`text`:`password`,class:u,prefixCls:b.value,suffix:l};return n&&(f.size=n),(0,s.createVNode)(o.default,{ref:g,...f},c)};return()=>x()}});exports.default=d;