import{filterEmpty as f}from"../../_util/props-util/index.mjs";const u=r=>r!=null&&(Array.isArray(r)?f(r).length:!0);function a(r){return u(r.prefix)||u(r.suffix)||u(r.allowClear)}function d(r){return u(r.addonBefore)||u(r.addonAfter)}function l(r){return typeof r>"u"||r===null?"":String(r)}function s(r,i,t,n){if(!t)return;const e=i;if(i.type==="click"){Object.defineProperty(e,"target",{writable:!0}),Object.defineProperty(e,"currentTarget",{writable:!0});const c=r.cloneNode(!0);e.target=c,e.currentTarget=c,c.value="",t(e);return}if(n!==void 0){Object.defineProperty(e,"target",{writable:!0}),Object.defineProperty(e,"currentTarget",{writable:!0}),e.target=r,e.currentTarget=r,r.value=n,t(e);return}t(e)}function g(r,i){if(!r)return;r.focus(i);const{cursor:t}=i||{};if(t){const n=r.value.length;switch(t){case"start":r.setSelectionRange(0,0);break;case"end":r.setSelectionRange(n,n);break;default:r.setSelectionRange(0,n)}}}export{l as fixControlledValue,d as hasAddon,a as hasPrefixSuffix,s as resolveOnChange,g as triggerFocus};
