const e=require("./vue-types/index.js"),t=require("../vc-util/Dom/css.js"),n=require("./BaseInputInner.js");let r=require("vue");var i=(0,r.defineComponent)({compatConfig:{MODE:3},inheritAttrs:!1,props:{disabled:e.default.looseBool,type:e.default.string,value:e.default.any,lazy:e.default.bool.def(!0),tag:{type:String,default:`input`},size:e.default.string,style:e.default.oneOfType([String,Object]),class:e.default.string},emits:[`change`,`input`,`blur`,`keydown`,`focus`,`compositionstart`,`compositionend`,`keyup`,`paste`,`mousedown`],setup(e,{emit:i,attrs:a,expose:o}){let s=(0,r.shallowRef)(null),c=(0,r.ref)(),l=(0,r.ref)(!1);(0,r.watch)([()=>e.value,l],()=>{l.value||(c.value=e.value)},{immediate:!0});let u=e=>{i(`change`,e)},d=e=>{l.value=!0,e.target.composing=!0,i(`compositionstart`,e)},f=e=>{l.value=!1,e.target.composing=!1,i(`compositionend`,e);let t=document.createEvent(`HTMLEvents`);t.initEvent(`input`,!0,!0),e.target.dispatchEvent(t),u(e)},p=t=>{if(l.value&&e.lazy){c.value=t.target.value;return}i(`input`,t)},m=e=>{i(`blur`,e)},h=e=>{i(`focus`,e)},g=()=>{s.value&&s.value.focus()},_=()=>{s.value&&s.value.blur()},v=e=>{i(`keydown`,e)},y=e=>{i(`keyup`,e)};o({focus:g,blur:_,input:(0,r.computed)(()=>s.value?.input),setSelectionRange:(e,t,n)=>{s.value?.setSelectionRange(e,t,n)},select:()=>{s.value?.select()},getSelectionStart:()=>s.value?.getSelectionStart(),getSelectionEnd:()=>s.value?.getSelectionEnd(),getScrollTop:()=>s.value?.getScrollTop()});let b=e=>{i(`mousedown`,e)},x=e=>{i(`paste`,e)},S=(0,r.computed)(()=>e.style&&typeof e.style!=`string`?t.styleObjectToString(e.style):e.style);return()=>{let{style:t,lazy:i,...o}=e;return(0,r.createVNode)(n.default,{...o,...a,style:S.value,onInput:p,onChange:u,onBlur:m,onFocus:h,ref:s,value:c.value,onCompositionstart:d,onCompositionend:f,onKeyup:y,onKeydown:v,onPaste:x,onMousedown:b},null)}}});exports.default=i;